Skip to content

Commit 8c9e9a7

Browse files
committed
Fix Isset and Empty with FiberScope
1 parent e4ba35f commit 8c9e9a7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Analyser/NodeScopeResolver.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3838,9 +3838,10 @@ function (MutatingScope $scope) use ($stmt, $expr, $nodeCallback, $context, $sto
38383838
$this->callNodeCallback($nodeCallback, $expr->name, $scope, $storage);
38393839
}
38403840
} elseif ($expr instanceof Expr\Empty_) {
3841+
$this->processExprNode($stmt, $expr->expr, $scope, $storage, new NoopNodeCallback(), $context->enterDeep());
38413842
$nonNullabilityResult = $this->ensureNonNullability($scope, $expr->expr);
38423843
$scope = $this->lookForSetAllowedUndefinedExpressions($nonNullabilityResult->getScope(), $expr->expr);
3843-
$result = $this->processExprNode($stmt, $expr->expr, $scope, $storage, $nodeCallback, $context->enterDeep());
3844+
$result = $this->processExprNode($stmt, $this->deepNodeCloner->cloneNode($expr->expr), $scope, $storage, $nodeCallback, $context->enterDeep());
38443845
$scope = $result->getScope();
38453846
$hasYield = $result->hasYield();
38463847
$throwPoints = $result->getThrowPoints();
@@ -3855,9 +3856,10 @@ function (MutatingScope $scope) use ($stmt, $expr, $nodeCallback, $context, $sto
38553856
$nonNullabilityResults = [];
38563857
$isAlwaysTerminating = false;
38573858
foreach ($expr->vars as $var) {
3859+
$this->processExprNode($stmt, $var, $scope, $storage, new NoopNodeCallback(), $context->enterDeep());
38583860
$nonNullabilityResult = $this->ensureNonNullability($scope, $var);
38593861
$scope = $this->lookForSetAllowedUndefinedExpressions($nonNullabilityResult->getScope(), $var);
3860-
$result = $this->processExprNode($stmt, $var, $scope, $storage, $nodeCallback, $context->enterDeep());
3862+
$result = $this->processExprNode($stmt, $this->deepNodeCloner->cloneNode($var), $scope, $storage, $nodeCallback, $context->enterDeep());
38613863
$scope = $result->getScope();
38623864
$hasYield = $hasYield || $result->hasYield();
38633865
$throwPoints = array_merge($throwPoints, $result->getThrowPoints());

0 commit comments

Comments
 (0)