We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 66908f1 commit 73ac58eCopy full SHA for 73ac58e
classes/tests/critical.php
@@ -27,7 +27,8 @@ class critical {
27
'variableInterpolation',
28
'duplicateFunctionParameter',
29
'reservedNames',
30
- 'deprecatedFunctions'
+ 'deprecatedFunctions',
31
+ 'newOperatorWithReference',
32
];
33
34
/**
@@ -116,5 +117,21 @@ public function _deprecatedFunctions($line) {
116
117
}
118
return false;
119
120
+
121
+ /**
122
+ * New objects cannot be assigned by reference
123
+ *
124
+ * @access public
125
+ * @param string Line to test against.
126
+ * @return boolean Line matches test.
127
+ */
128
+ public function _newOperatorWithReference($line) {
129
+ $regex = "#&\s?new\s#";
130
131
+ if (preg_match($regex, $line)) {
132
+ return true;
133
+ }
134
+ return false;
135
136
-?>
137
+?>
0 commit comments