diff options
author | Sara Golemon <pollita@php.net> | 2007-07-21 05:27:07 +0000 |
---|---|---|
committer | Sara Golemon <pollita@php.net> | 2007-07-21 05:27:07 +0000 |
commit | b1bc911ceee4dd52c004d2793b258869d7c52472 (patch) | |
tree | 67747e63b6b2a7f8fc43159c941af2ee7952d677 | |
parent | 562a0629e4de9343df3ca6e2dc40effb06d792d5 (diff) | |
download | php-git-b1bc911ceee4dd52c004d2793b258869d7c52472.tar.gz |
Add support got zend_class_entry->get_static_method() and matching __callStatic() userspace method @doc
-rwxr-xr-x | Zend/tests/call_static.phpt | 20 | ||||
-rwxr-xr-x | Zend/tests/object_handlers.phpt | 6 | ||||
-rw-r--r-- | Zend/zend.h | 2 | ||||
-rw-r--r-- | Zend/zend_API.c | 21 | ||||
-rw-r--r-- | Zend/zend_API.h | 2 | ||||
-rw-r--r-- | Zend/zend_compile.c | 7 | ||||
-rw-r--r-- | Zend/zend_compile.h | 1 | ||||
-rw-r--r-- | Zend/zend_execute_API.c | 8 | ||||
-rwxr-xr-x | Zend/zend_interfaces.c | 2 | ||||
-rw-r--r-- | Zend/zend_object_handlers.c | 79 | ||||
-rw-r--r-- | Zend/zend_vm_def.h | 6 | ||||
-rw-r--r-- | Zend/zend_vm_execute.h | 60 |
12 files changed, 192 insertions, 22 deletions
diff --git a/Zend/tests/call_static.phpt b/Zend/tests/call_static.phpt new file mode 100755 index 0000000000..e77a158914 --- /dev/null +++ b/Zend/tests/call_static.phpt @@ -0,0 +1,20 @@ +--TEST-- +__callStatic() Magic method +--FILE-- +<?php +class Test +{ + static function __callStatic($fname, $args) + { + echo $fname, '() called with ', count($args), " arguments\n"; + } +} + +call_user_func("Test::Two", 'A', 'B'); +call_user_func(array("Test", "Three"), NULL, 0, false); +Test::Four(5, 6, 7, 8); + +--EXPECT-- +two() called with 2 arguments +three() called with 3 arguments +four() called with 4 arguments diff --git a/Zend/tests/object_handlers.phpt b/Zend/tests/object_handlers.phpt index c14f604749..3e8dfcc537 100755 --- a/Zend/tests/object_handlers.phpt +++ b/Zend/tests/object_handlers.phpt @@ -16,6 +16,9 @@ class foo implements ArrayAccess { function __call($func, $args) { $GLOBALS["y"] = $func; } + static function __callStatic($func, $args) { + $GLOBALS["y"] = $func; + } function offsetGet($index) { $GLOBALS["y"] = $index; } @@ -40,6 +43,8 @@ $x->const_set = 1; echo $y,"\n"; $x->const_call(); echo $y,"\n"; +foo::const_callstatic(); +echo $y,"\n"; $z = $x["const_dim_get"]; echo $y,"\n"; $x["const_dim_set"] = 1; @@ -136,6 +141,7 @@ echo $y,"\n"; const_get const_set const_call +const_callstatic const_dim_get const_dim_set const_dim_isset diff --git a/Zend/zend.h b/Zend/zend.h index 63e3181934..f503199fb5 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -378,6 +378,7 @@ struct _zend_class_entry { union _zend_function *__unset; union _zend_function *__isset; union _zend_function *__call; + union _zend_function *__callstatic; union _zend_function *__tostring; union _zend_function *serialize_func; union _zend_function *unserialize_func; @@ -388,6 +389,7 @@ struct _zend_class_entry { zend_object_value (*create_object)(zend_class_entry *class_type TSRMLS_DC); zend_object_iterator *(*get_iterator)(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC); int (*interface_gets_implemented)(zend_class_entry *iface, zend_class_entry *class_type TSRMLS_DC); /* a class implements this interface */ + union _zend_function *(*get_static_method)(zend_class_entry *ce, zstr method, int method_len TSRMLS_DC); /* serializer callbacks */ int (*serialize)(zval *object, int *type, zstr *buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC); diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 5c4c923b08..dc55fec38d 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -2026,6 +2026,9 @@ ZEND_API void zend_check_magic_method_implementation(zend_class_entry *ce, zend_ } else if (lcname_len == sizeof(ZEND_CALL_FUNC_NAME) - 1 && ZEND_U_EQUAL(utype, lcname, lcname_len, ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME)-1) && fptr->common.num_args != 2) { zend_error(error_type, "Method %v::%s() must take exactly 2 arguments", ce->name, ZEND_CALL_FUNC_NAME); + } else if (lcname_len == sizeof(ZEND_CALLSTATIC_FUNC_NAME) - 1 && + ZEND_U_EQUAL(utype, lcname, lcname_len, ZEND_CALLSTATIC_FUNC_NAME, sizeof(ZEND_CALLSTATIC_FUNC_NAME)-1) && fptr->common.num_args != 2) { + zend_error(error_type, "Method %v::%s() must take exactly 2 arguments", ce->name, ZEND_CALLSTATIC_FUNC_NAME); } else if (lcname_len == sizeof(ZEND_TOSTRING_FUNC_NAME) - 1 && ZEND_U_EQUAL(utype, lcname, lcname_len, ZEND_TOSTRING_FUNC_NAME, sizeof(ZEND_TOSTRING_FUNC_NAME)-1) && fptr->common.num_args != 0) { zend_error(error_type, "Method %v::%s() cannot take arguments", ce->name, ZEND_TOSTRING_FUNC_NAME); @@ -2043,7 +2046,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr int count=0, unload=0; HashTable *target_function_table = function_table; int error_type; - zend_function *ctor = NULL, *dtor = NULL, *clone = NULL, *__get = NULL, *__set = NULL, *__unset = NULL, *__isset = NULL, *__call = NULL, *__tostring = NULL; + zend_function *ctor = NULL, *dtor = NULL, *clone = NULL, *__get = NULL, *__set = NULL, *__unset = NULL, *__isset = NULL, *__call = NULL, *__callstatic = NULL, *__tostring = NULL; char *lowercase_name; int fname_len; zstr lc_class_name = NULL_ZSTR; @@ -2186,6 +2189,8 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr clone = reg_function; } else if ((fname_len == sizeof(ZEND_CALL_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME))) { __call = reg_function; + } else if ((fname_len == sizeof(ZEND_CALLSTATIC_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_CALLSTATIC_FUNC_NAME, sizeof(ZEND_CALLSTATIC_FUNC_NAME))) { + __callstatic = reg_function; } else if ((fname_len == sizeof(ZEND_TOSTRING_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_TOSTRING_FUNC_NAME, sizeof(ZEND_TOSTRING_FUNC_NAME))) { __tostring = reg_function; } else if ((fname_len == sizeof(ZEND_GET_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_GET_FUNC_NAME, sizeof(ZEND_GET_FUNC_NAME))) { @@ -2226,6 +2231,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr scope->destructor = dtor; scope->clone = clone; scope->__call = __call; + scope->__callstatic = __callstatic; scope->__tostring = __tostring; scope->__get = __get; scope->__set = __set; @@ -2258,6 +2264,12 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr } __call->common.fn_flags &= ~ZEND_ACC_ALLOW_STATIC; } + if (__callstatic) { + if (!(__callstatic->common.fn_flags & ZEND_ACC_STATIC)) { + zend_error(error_type, "Method %v::%v() must be static", scope->name, __callstatic->common.function_name); + } + __callstatic->common.fn_flags |= ZEND_ACC_STATIC; + } if (__tostring) { if (__tostring->common.fn_flags & ZEND_ACC_STATIC) { zend_error(error_type, "Method %v::%v() cannot be static", scope->name, __tostring->common.function_name); @@ -2662,6 +2674,10 @@ static int zend_is_callable_check_func(int check_flags, zval ***zobj_ptr_ptr, ze retval = (*ce_ptr)->__call != NULL; *fptr_ptr = (*ce_ptr)->__call; } + if (!*zobj_ptr_ptr && *ce_ptr && (*ce_ptr)->__callstatic) { + retval = 1; + *fptr_ptr = (*ce_ptr)->__callstatic; + } } else { *fptr_ptr = fptr; if (*ce_ptr) { @@ -2951,7 +2967,8 @@ ZEND_API int zend_fcall_info_init(zval *callable, zend_fcall_info *fci, zend_fca fci->no_separation = 1; fci->symbol_table = NULL; - if (ZEND_U_EQUAL(ZEND_STR_TYPE, func->common.function_name, USTR_LEN(func->common.function_name), ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME)-1)) { + if (ZEND_U_CASE_EQUAL(ZEND_STR_TYPE, func->common.function_name, USTR_LEN(func->common.function_name), ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME)-1) || + ZEND_U_CASE_EQUAL(ZEND_STR_TYPE, func->common.function_name, USTR_LEN(func->common.function_name), ZEND_CALLSTATIC_FUNC_NAME, sizeof(ZEND_CALLSTATIC_FUNC_NAME)-1)) { fcc->initialized = 0; fcc->function_handler = NULL; fcc->calling_scope = NULL; diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 4302c0f5a8..2200d7c283 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -148,7 +148,9 @@ typedef struct _zend_function_entry { class_container.unserialize = NULL; \ class_container.create_object = NULL; \ class_container.interface_gets_implemented = NULL; \ + class_container.get_static_method = NULL; \ class_container.__call = handle_fcall; \ + class_container.__callstatic = NULL; \ class_container.__tostring = NULL; \ class_container.__get = handle_propget; \ class_container.__set = handle_propset; \ diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index bcbc894dc1..86abed6890 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -1222,6 +1222,8 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n CG(active_class_entry)->clone = (zend_function *) CG(active_op_array); } else if ((lcname_len == sizeof(ZEND_CALL_FUNC_NAME)-1) && (ZEND_U_EQUAL(Z_TYPE(function_name->u.constant), lcname, lcname_len, ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME)-1))) { CG(active_class_entry)->__call = (zend_function *) CG(active_op_array); + } else if ((lcname_len == sizeof(ZEND_CALLSTATIC_FUNC_NAME)-1) && (ZEND_U_EQUAL(Z_TYPE(function_name->u.constant), lcname, lcname_len, ZEND_CALLSTATIC_FUNC_NAME, sizeof(ZEND_CALLSTATIC_FUNC_NAME)-1))) { + CG(active_class_entry)->__callstatic = (zend_function *) CG(active_op_array); } else if ((lcname_len == sizeof(ZEND_GET_FUNC_NAME)-1) && (ZEND_U_EQUAL(Z_TYPE(function_name->u.constant), lcname, lcname_len, ZEND_GET_FUNC_NAME, sizeof(ZEND_GET_FUNC_NAME)-1))) { CG(active_class_entry)->__get = (zend_function *) CG(active_op_array); } else if ((lcname_len == sizeof(ZEND_SET_FUNC_NAME)-1) && (ZEND_U_EQUAL(Z_TYPE(function_name->u.constant), lcname, lcname_len, ZEND_SET_FUNC_NAME, sizeof(ZEND_SET_FUNC_NAME)-1))) { @@ -2185,6 +2187,9 @@ static void do_inherit_parent_constructor(zend_class_entry *ce TSRMLS_DC) /* {{{ if (!ce->__call) { ce->__call = ce->parent->__call; } + if (!ce->__callstatic) { + ce->__callstatic = ce->parent->__callstatic; + } if (!ce->__tostring) { ce->__tostring = ce->parent->__tostring; } @@ -4670,11 +4675,13 @@ ZEND_API void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify ce->__unset = NULL; ce->__isset = NULL; ce->__call = NULL; + ce->__callstatic = NULL; ce->__tostring = NULL; ce->create_object = NULL; ce->get_iterator = NULL; ce->iterator_funcs.funcs = NULL; ce->interface_gets_implemented = NULL; + ce->get_static_method = NULL; ce->parent = NULL; ce->num_interfaces = 0; ce->interfaces = NULL; diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index 69fd1571ea..fc0fe81b29 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -742,6 +742,7 @@ END_EXTERN_C() #define ZEND_UNSET_FUNC_NAME "__unset" #define ZEND_ISSET_FUNC_NAME "__isset" #define ZEND_CALL_FUNC_NAME "__call" +#define ZEND_CALLSTATIC_FUNC_NAME "__callstatic" #define ZEND_TOSTRING_FUNC_NAME "__tostring" #define ZEND_AUTOLOAD_FUNC_NAME "__autoload" diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 84a41c7558..28d866c244 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -882,9 +882,13 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS unsigned int lcname_len; zstr lcname = zend_u_str_case_fold(Z_TYPE_P(fci->function_name), fname, fname_len, 1, &lcname_len); - EX(function_state).function = - zend_std_get_static_method(calling_scope, lcname, lcname_len TSRMLS_CC); + if (calling_scope->get_static_method) { + EX(function_state).function = calling_scope->get_static_method(calling_scope, lcname, lcname_len TSRMLS_CC); + } else { + EX(function_state).function = zend_std_get_static_method(calling_scope, lcname, lcname_len TSRMLS_CC); + } efree(lcname.v); + if (check_scope_or_static && EX(function_state).function && !(EX(function_state).function->common.fn_flags & ZEND_ACC_STATIC) && !instanceof_function(check_scope_or_static, calling_scope TSRMLS_CC)) { diff --git a/Zend/zend_interfaces.c b/Zend/zend_interfaces.c index 8160112ab1..19c9337a78 100755 --- a/Zend/zend_interfaces.c +++ b/Zend/zend_interfaces.c @@ -57,7 +57,7 @@ ZEND_API zval* zend_u_call_method(zval **object_pp, zend_class_entry *obj_ce, ze if (!fn_proxy && !obj_ce) { /* no interest in caching and no information already present that is * needed later inside zend_call_function. */ - ZVAL_ZSTRL(&z_fname, function_name_type, function_name, function_name_len, 1); + ZVAL_ZSTRL(&z_fname, function_name_type, function_name, function_name_len, ZSTR_DUPLICATE); fci.function_table = !object_pp ? EG(function_table) : NULL; result = zend_call_function(&fci, NULL TSRMLS_CC); zval_dtor(&z_fname); diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 3a893f8dcb..16d660b3ef 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -858,21 +858,88 @@ static union _zend_function *zend_std_get_method(zval **object_ptr, zstr method_ } /* }}} */ -/* This is not (yet?) in the API, but it belongs in the built-in objects callbacks */ +ZEND_API void zend_std_callstatic_user_call(INTERNAL_FUNCTION_PARAMETERS) /* {{{ */ +{ + zend_internal_function *func = (zend_internal_function *)EG(function_state_ptr)->function; + zval *method_name_ptr, *method_args_ptr; + zval *method_result_ptr = NULL; + zend_class_entry *ce = EG(scope); + + ALLOC_ZVAL(method_args_ptr); + INIT_PZVAL(method_args_ptr); + array_init(method_args_ptr); + + if (zend_copy_parameters_array(ZEND_NUM_ARGS(), method_args_ptr TSRMLS_CC) == FAILURE) { + zval_dtor(method_args_ptr); + zend_error(E_ERROR, "Cannot get arguments for " ZEND_CALLSTATIC_FUNC_NAME); + RETURN_FALSE; + } + + ALLOC_ZVAL(method_name_ptr); + INIT_PZVAL(method_name_ptr); + ZVAL_TEXT(method_name_ptr, func->function_name, 0); /* no dup - it's a copy */ + + /* __callStatic handler is called with two arguments: + method name + array of method parameters + */ + zend_call_method_with_2_params(NULL, ce, &ce->__callstatic, ZEND_CALLSTATIC_FUNC_NAME, &method_result_ptr, method_name_ptr, method_args_ptr); + + if (method_result_ptr) { + if (method_result_ptr->is_ref || method_result_ptr->refcount > 1) { + RETVAL_ZVAL(method_result_ptr, 1, 1); + } else { + RETVAL_ZVAL(method_result_ptr, 0, 1); + } + } + + /* now destruct all auxiliaries */ + zval_ptr_dtor(&method_args_ptr); + zval_ptr_dtor(&method_name_ptr); + + /* destruct the function also, then - we have allocated it in get_method */ + efree(func); +} +/* }}} */ + + ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zstr function_name_strval, int function_name_strlen TSRMLS_DC) /* {{{ */ { zend_function *fbc; /* FIXME: type is default */ zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING; - if (zend_u_hash_find(&ce->function_table, type, function_name_strval, function_name_strlen+1, (void **) &fbc)==FAILURE) { - zstr class_name = ce->name; + if (zend_u_hash_find(&ce->function_table, type, function_name_strval, function_name_strlen + 1, (void **) &fbc)==FAILURE) { + if (ce->__callstatic) { + zend_internal_function *callstatic_user_call = emalloc(sizeof(zend_internal_function)); + callstatic_user_call->type = ZEND_INTERNAL_FUNCTION; + callstatic_user_call->module = ce->module; + callstatic_user_call->handler = zend_std_callstatic_user_call; + callstatic_user_call->arg_info = NULL; + callstatic_user_call->num_args = 0; + callstatic_user_call->scope = ce; + callstatic_user_call->fn_flags = ZEND_ACC_STATIC | ZEND_ACC_PUBLIC; + + if (UG(unicode)) { + callstatic_user_call->function_name.u = eustrndup(function_name_strval.u, function_name_strlen); + } else { + callstatic_user_call->function_name.s = estrndup(function_name_strval.s, function_name_strlen); + } + + callstatic_user_call->pass_rest_by_reference = 0; + callstatic_user_call->return_reference = ZEND_RETURN_VALUE; + + return (zend_function *)callstatic_user_call; + } else { + zstr class_name = ce->name; - if (!class_name.v) { - class_name.u = EMPTY_STR; + if (!class_name.v) { + class_name.u = EMPTY_STR; + } + zend_error(E_ERROR, "Call to undefined method %R::%R()", type, class_name, type, function_name_strval); } - zend_error(E_ERROR, "Call to undefined method %R::%R()", type, class_name, type, function_name_strval); } + #if MBO_0 /* right now this function is used for non static method lookup too */ /* Is the function static */ diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 1d1789038f..479610cbcb 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -1848,7 +1848,11 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMP|VAR|UNUS function_name_strval = zend_u_str_case_fold(Z_TYPE_P(function_name), Z_UNIVAL_P(function_name), Z_UNILEN_P(function_name), 1, &function_name_strlen); } - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + if (ce->get_static_method) { + EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + } else { + EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + } if (!is_const) { efree(function_name_strval.v); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index c9f991038c..c985417621 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -2602,7 +2602,11 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HAN function_name_strval = zend_u_str_case_fold(Z_TYPE_P(function_name), Z_UNIVAL_P(function_name), Z_UNILEN_P(function_name), 1, &function_name_strlen); } - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + if (ce->get_static_method) { + EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + } else { + EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + } if (!is_const) { efree(function_name_strval.v); @@ -3062,7 +3066,11 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDL function_name_strval = zend_u_str_case_fold(Z_TYPE_P(function_name), Z_UNIVAL_P(function_name), Z_UNILEN_P(function_name), 1, &function_name_strlen); } - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + if (ce->get_static_method) { + EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + } else { + EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + } if (!is_const) { efree(function_name_strval.v); @@ -3523,7 +3531,11 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDL function_name_strval = zend_u_str_case_fold(Z_TYPE_P(function_name), Z_UNIVAL_P(function_name), Z_UNILEN_P(function_name), 1, &function_name_strlen); } - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + if (ce->get_static_method) { + EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + } else { + EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + } if (!is_const) { efree(function_name_strval.v); @@ -3750,7 +3762,11 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HA function_name_strval = zend_u_str_case_fold(Z_TYPE_P(function_name), Z_UNIVAL_P(function_name), Z_UNILEN_P(function_name), 1, &function_name_strlen); } - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + if (ce->get_static_method) { + EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + } else { + EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + } if (!is_const) { efree(function_name_strval.v); @@ -4179,7 +4195,11 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLE function_name_strval = zend_u_str_case_fold(Z_TYPE_P(function_name), Z_UNIVAL_P(function_name), Z_UNILEN_P(function_name), 1, &function_name_strlen); } - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + if (ce->get_static_method) { + EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + } else { + EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + } if (!is_const) { efree(function_name_strval.v); @@ -10044,7 +10064,11 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDL function_name_strval = zend_u_str_case_fold(Z_TYPE_P(function_name), Z_UNIVAL_P(function_name), Z_UNILEN_P(function_name), 1, &function_name_strlen); } - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + if (ce->get_static_method) { + EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + } else { + EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + } if (!is_const) { efree(function_name_strval.v); @@ -11736,7 +11760,11 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER function_name_strval = zend_u_str_case_fold(Z_TYPE_P(function_name), Z_UNIVAL_P(function_name), Z_UNILEN_P(function_name), 1, &function_name_strlen); } - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + if (ce->get_static_method) { + EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + } else { + EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + } if (!is_const) { efree(function_name_strval.v); @@ -13420,7 +13448,11 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER function_name_strval = zend_u_str_case_fold(Z_TYPE_P(function_name), Z_UNIVAL_P(function_name), Z_UNILEN_P(function_name), 1, &function_name_strlen); } - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + if (ce->get_static_method) { + EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + } else { + EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + } if (!is_const) { efree(function_name_strval.v); @@ -14302,7 +14334,11 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HAND function_name_strval = zend_u_str_case_fold(Z_TYPE_P(function_name), Z_UNIVAL_P(function_name), Z_UNILEN_P(function_name), 1, &function_name_strlen); } - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + if (ce->get_static_method) { + EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + } else { + EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + } if (!is_const) { efree(function_name_strval.v); @@ -15636,7 +15672,11 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ function_name_strval = zend_u_str_case_fold(Z_TYPE_P(function_name), Z_UNIVAL_P(function_name), Z_UNILEN_P(function_name), 1, &function_name_strlen); } - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + if (ce->get_static_method) { + EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + } else { + EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + } if (!is_const) { efree(function_name_strval.v); |