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
PHP objects are passed by pointer and readonly attribute applies the access modifier to the pointer itself, but the value of the object itself can be changed, since the object is not readonly (unless otherwise explicitly stated).
In contrast, arrays are passed by value (or more precisely, copy-on-write) and readonly is applied to the value itself.
Bug report
Not sure why phpstan report error here :)
Code snippet that reproduces the problem
https://phpstan.org/r/39b70b99-6927-44ef-b4df-3685d6c3dd6e
Expected output
No error.
Did PHPStan help you today? Did it make you happy in any way?
Yep 🤗
The text was updated successfully, but these errors were encountered: