@@ -4690,7 +4690,7 @@ private function processClosureNode(
46904690 array_merge ($ statementResult ->getImpurePoints (), $ closureImpurePoints ),
46914691 ), $ closureScope );
46924692
4693- return new ProcessClosureResult ($ scope , $ statementResult ->getThrowPoints (), $ statementResult ->getImpurePoints (), $ invalidateExpressions );
4693+ return new ProcessClosureResult ($ scope , $ statementResult ->getThrowPoints (), $ statementResult ->getImpurePoints (), $ invalidateExpressions, $ statementResult -> isAlwaysTerminating () );
46944694 }
46954695
46964696 $ count = 0 ;
@@ -4736,7 +4736,7 @@ private function processClosureNode(
47364736 array_merge ($ statementResult ->getImpurePoints (), $ closureImpurePoints ),
47374737 ), $ closureScope );
47384738
4739- return new ProcessClosureResult ($ scope ->processClosureScope ($ closureResultScope , null , $ byRefUses ), $ statementResult ->getThrowPoints (), $ statementResult ->getImpurePoints (), $ invalidateExpressions );
4739+ return new ProcessClosureResult ($ scope ->processClosureScope ($ closureResultScope , null , $ byRefUses ), $ statementResult ->getThrowPoints (), $ statementResult ->getImpurePoints (), $ invalidateExpressions, $ statementResult -> isAlwaysTerminating () );
47404740 }
47414741
47424742 /**
@@ -5180,6 +5180,7 @@ private function processArgs(
51805180 if ($ callCallbackImmediately ) {
51815181 $ throwPoints = array_merge ($ throwPoints , array_map (static fn (ThrowPoint $ throwPoint ) => $ throwPoint ->isExplicit () ? ThrowPoint::createExplicit ($ scope , $ throwPoint ->getType (), $ arg ->value , $ throwPoint ->canContainAnyThrowable ()) : ThrowPoint::createImplicit ($ scope , $ arg ->value ), $ closureResult ->getThrowPoints ()));
51825182 $ impurePoints = array_merge ($ impurePoints , $ closureResult ->getImpurePoints ());
5183+ $ isAlwaysTerminating = $ isAlwaysTerminating || $ closureResult ->isAlwaysTerminating ();
51835184 }
51845185
51855186 $ uses = [];
0 commit comments