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
{{ message }}
Repository navigation
modify readonly class property with reference #10844
This seems fairly difficult to fix. The problem is that ArrayIterator copies the properties array without knowing whether the operation is R or RW and ZEND_FE_FETCH_RW converts the given value to a reference without knowing that the value came from an object. Thus we can neither trivially check if the property is readonly, nor add the ZEND_REF_ADD_TYPE_SOURCE when the value is converted to a reference.
Activity
ndossche commentedon Mar 13, 2023
Looks very related to #9432
iluuu1994 commentedon Mar 17, 2023
Also related, it's possible to skip the reference type check:
iluuu1994 commentedon Mar 17, 2023
This seems fairly difficult to fix. The problem is that
ArrayIteratorcopies the properties array without knowing whether the operation isRorRWandZEND_FE_FETCH_RWconverts the given value to a reference without knowing that the value came from an object. Thus we can neither trivially check if the property isreadonly, nor add theZEND_REF_ADD_TYPE_SOURCEwhen the value is converted to a reference.We could specifically fix this for
ArrayIterator, which I tried here:master...iluuu1994:php-src:gh-10844
It's not pretty but I don't know how else we could solve this without modifying both the iterator API and the internals of spl_object quite heavily.