Skip to content

Commit 86bd10e

Browse files
committed
more pureness tests for all code paths
1 parent 2e7f961 commit 86bd10e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/PHPStan/Rules/Pure/data/pure-function.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,4 +171,16 @@ function bug13288(array $a)
171171
array_push($a, function() { // error because by ref arg
172172
exit(); // ok, as array_push() will not invoke the function
173173
});
174+
175+
array_push($a, // error because by ref arg
176+
fn() => exit() // ok, as array_push() will not invoke the function
177+
);
178+
179+
$closure = function() {
180+
exit();
181+
};
182+
array_push($a, // error because by ref arg
183+
$closure // ok, as array_push() will not invoke the function
184+
);
174185
}
186+

0 commit comments

Comments
 (0)