@@ -3728,7 +3728,8 @@ private function enterAnonymousFunctionWithoutReflection(
3728
3728
$ nativeTypes [$ paramExprString ] = ExpressionTypeHolder::createYes ($ use ->var , $ variableNativeType );
3729
3729
}
3730
3730
3731
- foreach ($ this ->invalidateStaticExpressions ($ this ->expressionTypes ) as $ exprString => $ typeHolder ) {
3731
+ $ nonStaticExpressions = $ this ->invalidateStaticExpressions ($ this ->expressionTypes );
3732
+ foreach ($ nonStaticExpressions as $ exprString => $ typeHolder ) {
3732
3733
$ expr = $ typeHolder ->getExpr ();
3733
3734
3734
3735
if ($ expr instanceof Variable) {
@@ -3758,7 +3759,7 @@ private function enterAnonymousFunctionWithoutReflection(
3758
3759
$ nativeTypes ['$this ' ] = ExpressionTypeHolder::createYes ($ node , $ this ->getNativeType ($ node ));
3759
3760
3760
3761
if ($ this ->phpVersion ->supportsReadOnlyProperties ()) {
3761
- foreach ($ this -> invalidateStaticExpressions ( $ this -> expressionTypes ) as $ exprString => $ typeHolder ) {
3762
+ foreach ($ nonStaticExpressions as $ exprString => $ typeHolder ) {
3762
3763
$ expr = $ typeHolder ->getExpr ();
3763
3764
3764
3765
if (
0 commit comments