@@ -3705,7 +3705,8 @@ private function enterAnonymousFunctionWithoutReflection(
3705
3705
$ nativeTypes [$ paramExprString ] = ExpressionTypeHolder::createYes ($ use ->var , $ variableNativeType );
3706
3706
}
3707
3707
3708
- foreach ($ this ->invalidateStaticExpressions ($ this ->expressionTypes ) as $ exprString => $ typeHolder ) {
3708
+ $ nonStaticExpressions = $ this ->invalidateStaticExpressions ($ this ->expressionTypes );
3709
+ foreach ($ nonStaticExpressions as $ exprString => $ typeHolder ) {
3709
3710
$ expr = $ typeHolder ->getExpr ();
3710
3711
3711
3712
if ($ expr instanceof Variable) {
@@ -3735,7 +3736,7 @@ private function enterAnonymousFunctionWithoutReflection(
3735
3736
$ nativeTypes ['$this ' ] = ExpressionTypeHolder::createYes ($ node , $ this ->getNativeType ($ node ));
3736
3737
3737
3738
if ($ this ->phpVersion ->supportsReadOnlyProperties ()) {
3738
- foreach ($ this -> invalidateStaticExpressions ( $ this -> expressionTypes ) as $ exprString => $ typeHolder ) {
3739
+ foreach ($ nonStaticExpressions as $ exprString => $ typeHolder ) {
3739
3740
$ expr = $ typeHolder ->getExpr ();
3740
3741
3741
3742
if (
0 commit comments