@@ -2132,15 +2132,6 @@ static function (): void {
2132
2132
$ scope = $ scope ->afterOpenSslCall ($ functionReflection ->getName ());
2133
2133
}
2134
2134
2135
- if (
2136
- $ functionReflection !== null
2137
- && $ functionReflection ->hasSideEffects ()->yes ()
2138
- ) {
2139
- foreach ($ expr ->getArgs () as $ arg ) {
2140
- $ scope = $ scope ->invalidateExpression ($ arg ->value , true );
2141
- }
2142
- }
2143
-
2144
2135
} elseif ($ expr instanceof MethodCall) {
2145
2136
$ originalScope = $ scope ;
2146
2137
if (
@@ -2196,11 +2187,7 @@ static function (): void {
2196
2187
$ hasSideEffects = $ methodReflection ->hasSideEffects ();
2197
2188
if ($ hasSideEffects ->yes () || $ methodReflection ->getName () === '__construct ' ) {
2198
2189
$ scope = $ scope ->invalidateExpression ($ expr ->var , true );
2199
- foreach ($ expr ->getArgs () as $ arg ) {
2200
- $ scope = $ scope ->invalidateExpression ($ arg ->value , true );
2201
- }
2202
2190
}
2203
-
2204
2191
if ($ parametersAcceptor !== null ) {
2205
2192
$ selfOutType = $ methodReflection ->getSelfOutType ();
2206
2193
if ($ selfOutType !== null ) {
@@ -2373,14 +2360,6 @@ static function (): void {
2373
2360
$ scope = $ scope ->invalidateExpression (new Variable ('this ' ), true );
2374
2361
}
2375
2362
2376
- if ($ methodReflection !== null ) {
2377
- if ($ methodReflection ->hasSideEffects ()->yes () || $ methodReflection ->getName () === '__construct ' ) {
2378
- foreach ($ expr ->getArgs () as $ arg ) {
2379
- $ scope = $ scope ->invalidateExpression ($ arg ->value , true );
2380
- }
2381
- }
2382
- }
2383
-
2384
2363
$ hasYield = $ hasYield || $ result ->hasYield ();
2385
2364
$ throwPoints = array_merge ($ throwPoints , $ result ->getThrowPoints ());
2386
2365
} elseif ($ expr instanceof PropertyFetch) {
@@ -2689,12 +2668,6 @@ static function (): void {
2689
2668
$ expr ->getArgs (),
2690
2669
$ constructorReflection ->getVariants (),
2691
2670
);
2692
- $ hasSideEffects = $ constructorReflection ->hasSideEffects ();
2693
- if ($ hasSideEffects ->yes ()) {
2694
- foreach ($ expr ->getArgs () as $ arg ) {
2695
- $ scope = $ scope ->invalidateExpression ($ arg ->value , true );
2696
- }
2697
- }
2698
2671
$ constructorThrowPoint = $ this ->getConstructorThrowPoint ($ constructorReflection , $ parametersAcceptor , $ classReflection , $ expr , $ expr ->class , $ expr ->getArgs (), $ scope );
2699
2672
if ($ constructorThrowPoint !== null ) {
2700
2673
$ throwPoints [] = $ constructorThrowPoint ;
@@ -3623,7 +3596,11 @@ private function processArgs(
3623
3596
$ argValue = $ arg ->value ;
3624
3597
if ($ argValue instanceof Variable && is_string ($ argValue ->name )) {
3625
3598
$ scope = $ scope ->assignVariable ($ argValue ->name , $ byRefType , new MixedType ());
3599
+ } else {
3600
+ $ scope = $ scope ->invalidateExpression ($ argValue );
3626
3601
}
3602
+ } elseif ($ calleeReflection !== null && $ calleeReflection ->hasSideEffects ()->yes ()) {
3603
+ $ scope = $ scope ->invalidateExpression ($ arg ->value , true );
3627
3604
}
3628
3605
}
3629
3606
0 commit comments