Skip to content

Commit e4ba35f

Browse files
committed
Fix Coalesce with FiberScope
1 parent 98587b0 commit e4ba35f

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
@@ -3640,9 +3640,10 @@ function (MutatingScope $scope) use ($stmt, $expr, $nodeCallback, $context, $sto
36403640
$this->storeResult($storage, $expr, $result);
36413641
return $result;
36423642
} elseif ($expr instanceof Coalesce) {
3643+
$this->processExprNode($stmt, $expr->left, $scope, $storage, new NoopNodeCallback(), $context->enterDeep());
36433644
$nonNullabilityResult = $this->ensureNonNullability($scope, $expr->left);
36443645
$condScope = $this->lookForSetAllowedUndefinedExpressions($nonNullabilityResult->getScope(), $expr->left);
3645-
$condResult = $this->processExprNode($stmt, $expr->left, $condScope, $storage, $nodeCallback, $context->enterDeep());
3646+
$condResult = $this->processExprNode($stmt, $this->deepNodeCloner->cloneNode($expr->left), $condScope, $storage, $nodeCallback, $context->enterDeep());
36463647
$scope = $this->revertNonNullability($condResult->getScope(), $nonNullabilityResult->getSpecifiedExpressions());
36473648
$scope = $this->lookForUnsetAllowedUndefinedExpressions($scope, $expr->left);
36483649

0 commit comments

Comments
 (0)