Skip to content

Commit

Permalink
Allow nonexistent other-than-Variable expressions in by-ref parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Sep 10, 2024
1 parent d3a2a92 commit 00d2caf
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions src/Analyser/NodeScopeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -4570,20 +4570,18 @@ private function processArgs(

$lookForUnset = false;
if ($assignByReference) {
if ($arg->value instanceof Variable) {
$isBuiltin = false;
if ($calleeReflection instanceof FunctionReflection && $calleeReflection->isBuiltin()) {
$isBuiltin = true;
} elseif ($calleeReflection instanceof ExtendedMethodReflection && $calleeReflection->getDeclaringClass()->isBuiltin()) {
$isBuiltin = true;
}
if (
$isBuiltin
|| ($parameterNativeType === null || !$parameterNativeType->isNull()->no())
) {
$scope = $this->lookForSetAllowedUndefinedExpressions($scope, $arg->value);
$lookForUnset = true;
}
$isBuiltin = false;
if ($calleeReflection instanceof FunctionReflection && $calleeReflection->isBuiltin()) {
$isBuiltin = true;
} elseif ($calleeReflection instanceof ExtendedMethodReflection && $calleeReflection->getDeclaringClass()->isBuiltin()) {
$isBuiltin = true;
}
if (
$isBuiltin
|| ($parameterNativeType === null || !$parameterNativeType->isNull()->no())
) {
$scope = $this->lookForSetAllowedUndefinedExpressions($scope, $arg->value);
$lookForUnset = true;
}
}

Expand Down

0 comments on commit 00d2caf

Please sign in to comment.