You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm operating on an array with dynamic keys. When trying to add an item to a nested array right after initializing it, I get an error, telling me that I cannot assign a new offset to that array.
Bug report
I'm operating on an array with dynamic keys. When trying to add an item to a nested array right after initializing it, I get an error, telling me that I cannot assign a new offset to that array.
Code snippet that reproduces the problem
https://phpstan.org/r/7989deba-bb1e-4ad0-b070-c6de9bc2e4f3
The crucial part is this piece:
PHPStan complains about the assignment inside the foreach loop. But at this point,
$config['things']
is guaranteed to be an array.Expected output
No error.
Did PHPStan help you today? Did it make you happy in any way?
Only today? PHPStan improves my live as a developer every day!
The text was updated successfully, but these errors were encountered: