-
-
Notifications
You must be signed in to change notification settings - Fork 947
array_pop/array_shift false positive #2851
Copy link
Copy link
Closed
phpstan/phpstan-src
#1651Labels
Milestone
Description
Bug report
array_* false positive
while (count($arguments) > 0) {
$words .= array_pop($arguments);
if (count($arguments) > 0) {
$words .= ' ';
}
}Code snippet that reproduces the problem
$arguments = ['x', 'y'];
$words = '';
while (count($arguments) > 0) {
$words .= array_pop($arguments);
if (count($arguments) > 0) {
$words .= ' ';
}
}
echo $words;Expected output
No error
Reactions are currently unavailable