mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Remove some special-casing in zend_call_method()
Don't treat the !fn_proxy && !obj_ce case differently. There doesn't seem to be any need for it, and it will result in subtly different behavior (e.g. it will accept "Foo::bar" syntax, but break as soon as you pass in an fn_proxy cache).
This commit is contained in:
parent
596561009c
commit
be540b35d2
1 changed files with 42 additions and 50 deletions
|
@ -36,6 +36,7 @@ ZEND_API zval* zend_call_method(zend_object *object, zend_class_entry *obj_ce, z
|
||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
zend_fcall_info fci;
|
zend_fcall_info fci;
|
||||||
|
zend_fcall_info_cache fcic;
|
||||||
zval retval;
|
zval retval;
|
||||||
zval params[2];
|
zval params[2];
|
||||||
|
|
||||||
|
@ -52,15 +53,6 @@ ZEND_API zval* zend_call_method(zend_object *object, zend_class_entry *obj_ce, z
|
||||||
fci.param_count = param_count;
|
fci.param_count = param_count;
|
||||||
fci.params = params;
|
fci.params = params;
|
||||||
fci.no_separation = 1;
|
fci.no_separation = 1;
|
||||||
|
|
||||||
if (!fn_proxy && !obj_ce) {
|
|
||||||
/* no interest in caching and no information already present that is
|
|
||||||
* needed later inside zend_call_function. */
|
|
||||||
ZVAL_STRINGL(&fci.function_name, function_name, function_name_len);
|
|
||||||
result = zend_call_function(&fci, NULL);
|
|
||||||
zval_ptr_dtor(&fci.function_name);
|
|
||||||
} else {
|
|
||||||
zend_fcall_info_cache fcic;
|
|
||||||
ZVAL_UNDEF(&fci.function_name); /* Unused */
|
ZVAL_UNDEF(&fci.function_name); /* Unused */
|
||||||
|
|
||||||
if (!obj_ce) {
|
if (!obj_ce) {
|
||||||
|
@ -103,7 +95,7 @@ ZEND_API zval* zend_call_method(zend_object *object, zend_class_entry *obj_ce, z
|
||||||
}
|
}
|
||||||
fcic.object = object;
|
fcic.object = object;
|
||||||
result = zend_call_function(&fci, &fcic);
|
result = zend_call_function(&fci, &fcic);
|
||||||
}
|
|
||||||
if (result == FAILURE) {
|
if (result == FAILURE) {
|
||||||
/* error at c-level */
|
/* error at c-level */
|
||||||
if (!obj_ce) {
|
if (!obj_ce) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue