Skip to content

Commit f4e17d0

Browse files
committed
Fix Coalesce with FiberScope
1 parent 7b4c7b9 commit f4e17d0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Analyser/NodeScopeResolver.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3645,9 +3645,10 @@ function (MutatingScope $scope) use ($stmt, $expr, $nodeCallback, $context, $sto
36453645
$this->storeResult($storage, $expr, $result);
36463646
return $result;
36473647
} elseif ($expr instanceof Coalesce) {
3648+
$this->processExprNode($stmt, $expr->left, $scope, $storage, new NoopNodeCallback(), $context->enterDeep());
36483649
$nonNullabilityResult = $this->ensureNonNullability($scope, $expr->left);
36493650
$condScope = $this->lookForSetAllowedUndefinedExpressions($nonNullabilityResult->getScope(), $expr->left);
3650-
$condResult = $this->processExprNode($stmt, $expr->left, $condScope, $storage, $nodeCallback, $context->enterDeep());
3651+
$condResult = $this->processExprNode($stmt, $this->deepNodeCloner->cloneNode($expr->left), $condScope, $storage, $nodeCallback, $context->enterDeep());
36513652
$scope = $this->revertNonNullability($condResult->getScope(), $nonNullabilityResult->getSpecifiedExpressions());
36523653
$scope = $this->lookForUnsetAllowedUndefinedExpressions($scope, $expr->left);
36533654

0 commit comments

Comments
 (0)