@@ -2132,15 +2132,6 @@ static function (): void {
21322132 $ scope = $ scope ->afterOpenSslCall ($ functionReflection ->getName ());
21332133 }
21342134
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-
21442135 } elseif ($ expr instanceof MethodCall) {
21452136 $ originalScope = $ scope ;
21462137 if (
@@ -2196,11 +2187,7 @@ static function (): void {
21962187 $ hasSideEffects = $ methodReflection ->hasSideEffects ();
21972188 if ($ hasSideEffects ->yes () || $ methodReflection ->getName () === '__construct ' ) {
21982189 $ scope = $ scope ->invalidateExpression ($ expr ->var , true );
2199- foreach ($ expr ->getArgs () as $ arg ) {
2200- $ scope = $ scope ->invalidateExpression ($ arg ->value , true );
2201- }
22022190 }
2203-
22042191 if ($ parametersAcceptor !== null ) {
22052192 $ selfOutType = $ methodReflection ->getSelfOutType ();
22062193 if ($ selfOutType !== null ) {
@@ -2373,14 +2360,6 @@ static function (): void {
23732360 $ scope = $ scope ->invalidateExpression (new Variable ('this ' ), true );
23742361 }
23752362
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-
23842363 $ hasYield = $ hasYield || $ result ->hasYield ();
23852364 $ throwPoints = array_merge ($ throwPoints , $ result ->getThrowPoints ());
23862365 } elseif ($ expr instanceof PropertyFetch) {
@@ -2689,12 +2668,6 @@ static function (): void {
26892668 $ expr ->getArgs (),
26902669 $ constructorReflection ->getVariants (),
26912670 );
2692- $ hasSideEffects = $ constructorReflection ->hasSideEffects ();
2693- if ($ hasSideEffects ->yes ()) {
2694- foreach ($ expr ->getArgs () as $ arg ) {
2695- $ scope = $ scope ->invalidateExpression ($ arg ->value , true );
2696- }
2697- }
26982671 $ constructorThrowPoint = $ this ->getConstructorThrowPoint ($ constructorReflection , $ parametersAcceptor , $ classReflection , $ expr , $ expr ->class , $ expr ->getArgs (), $ scope );
26992672 if ($ constructorThrowPoint !== null ) {
27002673 $ throwPoints [] = $ constructorThrowPoint ;
@@ -3623,7 +3596,11 @@ private function processArgs(
36233596 $ argValue = $ arg ->value ;
36243597 if ($ argValue instanceof Variable && is_string ($ argValue ->name )) {
36253598 $ scope = $ scope ->assignVariable ($ argValue ->name , $ byRefType , new MixedType ());
3599+ } else {
3600+ $ scope = $ scope ->invalidateExpression ($ argValue );
36263601 }
3602+ } elseif ($ calleeReflection !== null && $ calleeReflection ->hasSideEffects ()->yes ()) {
3603+ $ scope = $ scope ->invalidateExpression ($ arg ->value , true );
36273604 }
36283605 }
36293606
0 commit comments