Skip to content

Conversation

@andrewnester
Copy link
Contributor

@andrewnester
Copy link
Contributor Author

Seems like failed test SERVER_PROTOCOL header availability [sapi/cli/tests/php_cli_server_008.phpt] isn't related to changes done.

@krakjoe krakjoe added the Bug label Mar 6, 2017
@andrewnester
Copy link
Contributor Author

@krakjoe any feedback on it?

}

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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@andrewnester
Copy link
Contributor Author

@nikic thanks! I improved my PR according to your comments.

@andrewnester
Copy link
Contributor Author

Seems like test failures unrelated to changes done

@nikic
Copy link
Member

nikic commented Mar 8, 2017

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.

@nikic nikic closed this Mar 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants