@@ -3289,7 +3289,7 @@ static function (): void {
3289
3289
return new ExpressionResult (
3290
3290
$ leftMergedWithRightScope ,
3291
3291
$ leftResult ->hasYield () || $ rightResult ->hasYield (),
3292
- false ,
3292
+ $ leftResult -> isAlwaysTerminating () || $ rightResult -> isAlwaysTerminating () ,
3293
3293
array_merge ($ leftResult ->getThrowPoints (), $ rightResult ->getThrowPoints ()),
3294
3294
array_merge ($ leftResult ->getImpurePoints (), $ rightResult ->getImpurePoints ()),
3295
3295
static fn (): MutatingScope => $ rightResult ->getScope ()->filterByTruthyValue ($ expr ),
@@ -3310,7 +3310,7 @@ static function (): void {
3310
3310
return new ExpressionResult (
3311
3311
$ leftMergedWithRightScope ,
3312
3312
$ leftResult ->hasYield () || $ rightResult ->hasYield (),
3313
- false ,
3313
+ $ leftResult -> isAlwaysTerminating () ,
3314
3314
array_merge ($ leftResult ->getThrowPoints (), $ rightResult ->getThrowPoints ()),
3315
3315
array_merge ($ leftResult ->getImpurePoints (), $ rightResult ->getImpurePoints ()),
3316
3316
static fn (): MutatingScope => $ leftMergedWithRightScope ->filterByTruthyValue ($ expr ),
@@ -3335,7 +3335,7 @@ static function (): void {
3335
3335
$ hasYield = $ condResult ->hasYield () || $ rightResult ->hasYield ();
3336
3336
$ throwPoints = array_merge ($ condResult ->getThrowPoints (), $ rightResult ->getThrowPoints ());
3337
3337
$ impurePoints = array_merge ($ condResult ->getImpurePoints (), $ rightResult ->getImpurePoints ());
3338
- $ isAlwaysTerminating = false ;
3338
+ $ isAlwaysTerminating = $ condResult -> isAlwaysTerminating () ;
3339
3339
} elseif ($ expr instanceof BinaryOp) {
3340
3340
$ result = $ this ->processExprNode ($ stmt , $ expr ->left , $ scope , $ nodeCallback , $ context ->enterDeep ());
3341
3341
$ scope = $ result ->getScope ();
@@ -3368,7 +3368,7 @@ static function (): void {
3368
3368
true ,
3369
3369
);
3370
3370
$ hasYield = $ result ->hasYield ();
3371
- $ isAlwaysTerminating = false ;
3371
+ $ isAlwaysTerminating = $ result -> isAlwaysTerminating () ;
3372
3372
$ scope = $ result ->getScope ()->afterExtractCall ();
3373
3373
} elseif ($ expr instanceof Expr \Print_) {
3374
3374
$ result = $ this ->processExprNode ($ stmt , $ expr ->expr , $ scope , $ nodeCallback , $ context ->enterDeep ());
0 commit comments