Bug report
Using array-access to write to an object field should not be considered a write-only operation, because the object may be used outside of the scope of the class the field it's used in.
This affects both ArrayAccess objects and also special-snowflakes like Threaded which masquerade as arrays without actually implementing ArrayAccess.
Code snippet that reproduces the problem
https://phpstan.org/r/cee77620-54cd-4324-a330-e2990e6edbaf
https://phpstan.org/r/0c8ef0d5-80d9-494d-a400-2b87d0d15b37
Expected output
No error should be reported in either test case.
Bug report
Using array-access to write to an object field should not be considered a write-only operation, because the object may be used outside of the scope of the class the field it's used in.
This affects both
ArrayAccessobjects and also special-snowflakes likeThreadedwhich masquerade as arrays without actually implementingArrayAccess.Code snippet that reproduces the problem
https://phpstan.org/r/cee77620-54cd-4324-a330-e2990e6edbaf
https://phpstan.org/r/0c8ef0d5-80d9-494d-a400-2b87d0d15b37
Expected output
No error should be reported in either test case.