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