@@ -2747,6 +2747,7 @@ public function processClosureNode(
27472747 'property assignment ' ,
27482748 true ,
27492749 );
2750+ $ invalidateExpressions [] = new InvalidateExprNode ($ node ->getPropertyFetch ());
27502751 return ;
27512752 }
27522753 if ($ node instanceof ExecutionEndNode) {
@@ -2849,7 +2850,8 @@ public function processImmediatelyCalledCallable(MutatingScope $scope, array $in
28492850 continue ;
28502851 }
28512852
2852- $ scope = $ scope ->invalidateExpression ($ invalidateExpression ->getExpr (), true );
2853+ $ requireMoreCharacters = $ invalidateExpression ->getExpr () instanceof Variable;
2854+ $ scope = $ scope ->invalidateExpression ($ invalidateExpression ->getExpr (), $ requireMoreCharacters );
28532855 }
28542856
28552857 return $ scope ;
@@ -3368,7 +3370,9 @@ public function processArgs(
33683370 $ scope = $ scope ->restoreThis ($ restoreThisScope );
33693371 }
33703372
3371- $ deferredInvalidateExpressions [] = [$ invalidateExpressions , $ uses ];
3373+ if ($ this ->callCallbackImmediately ($ parameter , $ parameterType , $ calleeReflection )) {
3374+ $ deferredInvalidateExpressions [] = [$ invalidateExpressions , $ uses ];
3375+ }
33723376 } elseif ($ arg ->value instanceof Expr \ArrowFunction) {
33733377 if (
33743378 $ closureBindScope === null
@@ -3416,8 +3420,8 @@ public function processArgs(
34163420 if ($ exprType ->isCallable ()->yes ()) {
34173421 $ acceptors = $ exprType ->getCallableParametersAcceptors ($ scope );
34183422 if (count ($ acceptors ) === 1 ) {
3419- $ deferredInvalidateExpressions [] = [$ acceptors [0 ]->getInvalidateExpressions (), $ acceptors [0 ]->getUsedVariables ()];
34203423 if ($ this ->callCallbackImmediately ($ parameter , $ parameterType , $ calleeReflection )) {
3424+ $ deferredInvalidateExpressions [] = [$ acceptors [0 ]->getInvalidateExpressions (), $ acceptors [0 ]->getUsedVariables ()];
34213425 $ callableThrowPoints = array_map (static fn (SimpleThrowPoint $ throwPoint ) => $ throwPoint ->isExplicit () ? InternalThrowPoint::createExplicit ($ scope , $ throwPoint ->getType (), $ arg ->value , $ throwPoint ->canContainAnyThrowable ()) : InternalThrowPoint::createImplicit ($ scope , $ arg ->value ), $ acceptors [0 ]->getThrowPoints ());
34223426 if (!$ this ->implicitThrows ) {
34233427 $ callableThrowPoints = array_values (array_filter ($ callableThrowPoints , static fn (InternalThrowPoint $ throwPoint ) => $ throwPoint ->isExplicit ()));
0 commit comments