diff --git a/src/Files/File.php b/src/Files/File.php index 81aa673095..ececc47fbe 100644 --- a/src/Files/File.php +++ b/src/Files/File.php @@ -2024,6 +2024,7 @@ public function isReference($stackPtr) if ($owner['code'] === T_FUNCTION || $owner['code'] === T_CLOSURE || $owner['code'] === T_FN + || $owner['code'] === T_USE ) { $params = $this->getMethodParameters($this->tokens[$lastBracket]['parenthesis_owner']); foreach ($params as $param) { @@ -2033,19 +2034,6 @@ public function isReference($stackPtr) } } }//end if - } else { - $prev = false; - for ($t = ($this->tokens[$lastBracket]['parenthesis_opener'] - 1); $t >= 0; $t--) { - if ($this->tokens[$t]['code'] !== T_WHITESPACE) { - $prev = $t; - break; - } - } - - if ($prev !== false && $this->tokens[$prev]['code'] === T_USE) { - // Closure use by reference. - return true; - } }//end if }//end if