@@ -4690,7 +4690,7 @@ private function processClosureNode(
4690
4690
array_merge ($ statementResult ->getImpurePoints (), $ closureImpurePoints ),
4691
4691
), $ closureScope );
4692
4692
4693
- return new ProcessClosureResult ($ scope , $ statementResult ->getThrowPoints (), $ statementResult ->getImpurePoints (), $ invalidateExpressions );
4693
+ return new ProcessClosureResult ($ scope , $ statementResult ->getThrowPoints (), $ statementResult ->getImpurePoints (), $ invalidateExpressions, $ statementResult -> isAlwaysTerminating () );
4694
4694
}
4695
4695
4696
4696
$ count = 0 ;
@@ -4736,7 +4736,7 @@ private function processClosureNode(
4736
4736
array_merge ($ statementResult ->getImpurePoints (), $ closureImpurePoints ),
4737
4737
), $ closureScope );
4738
4738
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 () );
4740
4740
}
4741
4741
4742
4742
/**
@@ -5174,6 +5174,7 @@ private function processArgs(
5174
5174
if ($ callCallbackImmediately ) {
5175
5175
$ 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 ()));
5176
5176
$ impurePoints = array_merge ($ impurePoints , $ closureResult ->getImpurePoints ());
5177
+ $ isAlwaysTerminating = $ isAlwaysTerminating || $ closureResult ->isAlwaysTerminating ();
5177
5178
}
5178
5179
5179
5180
$ uses = [];
0 commit comments