Fixed #74058 - ArrayObject doesn't call offsetGet if access property of ArrayObject property.#2402
Fixed #74058 - ArrayObject doesn't call offsetGet if access property of ArrayObject property.#2402andrewnester wants to merge 2 commits intophp:PHP-7.0from
Conversation
|
Seems like failed test |
|
@krakjoe any feedback on it? |
ext/spl/spl_array.c
Outdated
| } | ||
|
|
||
| if (check_inherited && intern->fptr_offset_get) { | ||
| zend_call_method_with_1_params(object, Z_OBJCE_P(object), &intern->fptr_offset_get, "offsetGet", retval, offset); |
There was a problem hiding this comment.
You're passing NULL as the retval, so the retval will be ignored. Please modify your test so that this is visible, e.g. with extra var dumps after the indirect modifications.
You need to pass a pointer to a zval here. Note that this is not actually possible while using get_property_ptr_ptr, which can only return owned storage. It's only possible to perform calls like this from read_property. So what you want to do is trigger a read_property fallback in get_property_ptr_ptr if offsetGet has been overridden.
fe3ee63 to
505bfd4
Compare
|
@nikic thanks! I improved my PR according to your comments. |
|
Seems like test failures unrelated to changes done |
|
Merged via 8f79913 into PHP 7.1+. Not applying to PHP 7.0, as changes like this tend to be risky -- based on prior experience, people rely on details of offsetGet/__get handling more than one might expect. |
Fix for https://bugs.php.net/bug.php?id=74058