Index: ext/standard/basic_functions.c =================================================================== RCS file: /repository/php-src/ext/standard/basic_functions.c,v retrieving revision 1.900 diff -u -p -r1.900 basic_functions.c --- ext/standard/basic_functions.c 24 May 2008 14:36:16 -0000 1.900 +++ ext/standard/basic_functions.c 24 Jun 2008 20:39:54 -0000 @@ -817,19 +817,6 @@ ZEND_BEGIN_ARG_INFO(arginfo_call_user_me ZEND_END_ARG_INFO() static -ZEND_BEGIN_ARG_INFO_EX(arginfo_forward_static_call, 0, 0, 1) - ZEND_ARG_INFO(0, function_name) - ZEND_ARG_INFO(0, parameter) - ZEND_ARG_INFO(0, ...) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_forward_static_call_array, 0, 0, 2) - ZEND_ARG_INFO(0, function_name) - ZEND_ARG_INFO(0, parameters) /* ARRAY_INFO(0, parameters, 1) */ -ZEND_END_ARG_INFO() - -static ZEND_BEGIN_ARG_INFO(arginfo_register_shutdown_function, 0) ZEND_ARG_INFO(0, function_name) ZEND_END_ARG_INFO() @@ -3402,8 +3389,6 @@ const zend_function_entry basic_function PHP_FE(call_user_func_array, arginfo_call_user_func_array) PHP_DEP_FE(call_user_method, arginfo_call_user_method) PHP_DEP_FE(call_user_method_array, arginfo_call_user_method_array) - PHP_FE(forward_static_call, arginfo_forward_static_call) - PHP_FE(forward_static_call_array, arginfo_forward_static_call_array) PHP_FE(serialize, arginfo_serialize) PHP_FE(unserialize, arginfo_unserialize) @@ -5221,66 +5206,6 @@ PHP_FUNCTION(call_user_method_array) } /* }}} */ -/* {{{ proto mixed forward_static_call(mixed function_name [, mixed parmeter] [, mixed ...]) U - Call a user function which is the first parameter */ -PHP_FUNCTION(forward_static_call) -{ - zval *retval_ptr = NULL; - zend_fcall_info fci; - zend_fcall_info_cache fci_cache; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "f*", &fci, &fci_cache, &fci.params, &fci.param_count) == FAILURE) { - return; - } - - if (!EG(active_op_array)->scope) { - zend_error(E_ERROR, "Cannot call forward_static_call() when no class scope is active"); - } - - fci.retval_ptr_ptr = &retval_ptr; - - if (EG(called_scope) && - instanceof_function(EG(called_scope), fci_cache.calling_scope TSRMLS_CC)) { - fci_cache.calling_scope = EG(called_scope); - } - - if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && fci.retval_ptr_ptr && *fci.retval_ptr_ptr) { - COPY_PZVAL_TO_ZVAL(*return_value, *fci.retval_ptr_ptr); - } - - if (fci.params) { - efree(fci.params); - } -} -/* }}} */ - -/* {{{ proto mixed call_user_func_array(string function_name, array parameters) U - Call a user function which is the first parameter with the arguments contained in array */ -PHP_FUNCTION(forward_static_call_array) -{ - zval *params, *retval_ptr = NULL; - zend_fcall_info fci; - zend_fcall_info_cache fci_cache; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "fa/", &fci, &fci_cache, ¶ms) == FAILURE) { - return; - } - - zend_fcall_info_args(&fci, params TSRMLS_CC); - fci.retval_ptr_ptr = &retval_ptr; - - if (EG(called_scope) && - instanceof_function(EG(called_scope), fci_cache.calling_scope TSRMLS_CC)) { - fci_cache.calling_scope = EG(called_scope); - } - - if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && fci.retval_ptr_ptr && *fci.retval_ptr_ptr) { - COPY_PZVAL_TO_ZVAL(*return_value, *fci.retval_ptr_ptr); - } - - zend_fcall_info_args_clear(&fci, 1); -} -/* }}} */ void user_shutdown_function_dtor(php_shutdown_function_entry *shutdown_function_entry) /* {{{ */ { Index: ext/standard/basic_functions.h =================================================================== RCS file: /repository/php-src/ext/standard/basic_functions.h,v retrieving revision 1.164 diff -u -p -r1.164 basic_functions.h --- ext/standard/basic_functions.h 24 May 2008 14:36:16 -0000 1.164 +++ ext/standard/basic_functions.h 24 Jun 2008 20:39:54 -0000 @@ -83,8 +83,6 @@ PHP_FUNCTION(call_user_func); PHP_FUNCTION(call_user_func_array); PHP_FUNCTION(call_user_method); PHP_FUNCTION(call_user_method_array); -PHP_FUNCTION(forward_static_call); -PHP_FUNCTION(forward_static_call_array); PHP_FUNCTION(register_shutdown_function); PHP_FUNCTION(highlight_file); Index: Zend/zend_API.c =================================================================== RCS file: /repository/ZendEngine2/zend_API.c,v retrieving revision 1.473 diff -u -p -r1.473 zend_API.c --- Zend/zend_API.c 5 Jun 2008 19:16:17 -0000 1.473 +++ Zend/zend_API.c 24 Jun 2008 20:39:55 -0000 @@ -2689,7 +2689,7 @@ ZEND_API int zend_disable_class(char *cl } /* }}} */ -static int zend_is_callable_check_func(int check_flags, zval ***zobj_ptr_ptr, zend_class_entry *ce_org, zval *callable, zend_class_entry **ce_ptr, zend_function **fptr_ptr, char **error TSRMLS_DC) /* {{{ */ +static int zend_is_callable_check_func(int check_flags, zval ***zobj_ptr_ptr, zend_class_entry *ce_org, zval *callable, zend_class_entry **ce_ptr, zend_uint *fetch_type, zend_function **fptr_ptr, char **error TSRMLS_DC) /* {{{ */ { int retval; zstr lmname, mname, colon = NULL_ZSTR; @@ -2772,6 +2772,7 @@ static int zend_is_callable_check_func(i EG(scope) = ce_org; } *ce_ptr = zend_u_fetch_class(Z_TYPE_P(callable), Z_UNIVAL_P(callable), clen, ZEND_FETCH_CLASS_AUTO | ZEND_FETCH_CLASS_SILENT TSRMLS_CC); + *fetch_type = zend_get_class_fetch_type(Z_TYPE_P(callable), Z_UNIVAL_P(callable), clen); EG(scope) = last_scope; if (!*ce_ptr) { if (error) { @@ -2887,11 +2888,12 @@ static int zend_is_callable_check_func(i } /* }}} */ -ZEND_API zend_bool zend_is_callable_ex(zval *callable, uint check_flags, zval *callable_name, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zval ***zobj_ptr_ptr, char **error TSRMLS_DC) /* {{{ */ +ZEND_API zend_bool zend_is_callable_ex(zval *callable, uint check_flags, zval *callable_name, zend_class_entry **ce_ptr, zend_uint *fetch_type, zend_function **fptr_ptr, zval ***zobj_ptr_ptr, char **error TSRMLS_DC) /* {{{ */ { zstr lcname; unsigned int lcname_len; zend_class_entry *ce_local, **pce; + zend_uint fetch_type_local; zend_function *fptr_local; zval **zobj_ptr_local; @@ -2910,7 +2912,12 @@ ZEND_API zend_bool zend_is_callable_ex(z if (error) { *error = NULL; } + if (fetch_type == NULL) { + fetch_type = &fetch_type_local; + } + *ce_ptr = NULL; + *fetch_type = 0; *fptr_ptr = NULL; *zobj_ptr_ptr = NULL; @@ -2926,7 +2933,7 @@ ZEND_API zend_bool zend_is_callable_ex(z return 1; } - return zend_is_callable_check_func(check_flags, zobj_ptr_ptr, NULL, callable, ce_ptr, fptr_ptr, error TSRMLS_CC); + return zend_is_callable_check_func(check_flags, zobj_ptr_ptr, NULL, callable, ce_ptr, fetch_type, fptr_ptr, error TSRMLS_CC); case IS_ARRAY: { @@ -3010,13 +3017,16 @@ ZEND_API zend_bool zend_is_callable_ex(z lcname_len == sizeof("self")-1 && ZEND_U_EQUAL(Z_TYPE_PP(obj), lcname, lcname_len, "self", sizeof("self")-1)) { ce = EG(active_op_array)->scope; + *fetch_type = ZEND_FETCH_CLASS_SELF; } else if (EG(active_op_array) && EG(active_op_array)->scope && lcname_len == sizeof("parent")-1 && ZEND_U_EQUAL(Z_TYPE_PP(obj), lcname, lcname_len, "parent", sizeof("parent")-1)) { ce = EG(active_op_array)->scope->parent; + *fetch_type = ZEND_FETCH_CLASS_PARENT; } else if (lcname_len == sizeof("static")-1 && ZEND_U_EQUAL(Z_TYPE_PP(obj), lcname, lcname_len, "static", sizeof("static")-1)) { ce = EG(called_scope); + *fetch_type = ZEND_FETCH_CLASS_STATIC; } else if (zend_u_lookup_class(Z_TYPE_PP(obj), Z_UNIVAL_PP(obj), Z_UNILEN_PP(obj), &pce TSRMLS_CC) == SUCCESS) { ce = *pce; } @@ -3071,7 +3081,7 @@ ZEND_API zend_bool zend_is_callable_ex(z } if (ce) { - return zend_is_callable_check_func(check_flags, zobj_ptr_ptr, ce, *method, ce_ptr, fptr_ptr, error TSRMLS_CC); + return zend_is_callable_check_func(check_flags, zobj_ptr_ptr, ce, *method, ce_ptr, fetch_type, fptr_ptr, error TSRMLS_CC); } else { if (error) zend_spprintf(error, 0, "first array member is not a valid %s", (Z_TYPE_PP(obj) == IS_STRING || Z_TYPE_PP(obj) == IS_UNICODE) ? "class name" : "object"); } @@ -3109,7 +3119,7 @@ ZEND_API zend_bool zend_is_callable(zval { TSRMLS_FETCH(); - return zend_is_callable_ex(callable, check_flags, callable_name, NULL, NULL, NULL, NULL TSRMLS_CC); + return zend_is_callable_ex(callable, check_flags, callable_name, NULL, NULL, NULL, NULL, NULL TSRMLS_CC); } /* }}} */ @@ -3119,7 +3129,7 @@ ZEND_API zend_bool zend_make_callable(zv zend_function *fptr; zval **zobj_ptr; - if (zend_is_callable_ex(callable, IS_CALLABLE_STRICT, callable_name, &ce, &fptr, &zobj_ptr, NULL TSRMLS_CC)) { + if (zend_is_callable_ex(callable, IS_CALLABLE_STRICT, callable_name, &ce, NULL, &fptr, &zobj_ptr, NULL TSRMLS_CC)) { if ((Z_TYPE_P(callable) == IS_STRING || Z_TYPE_P(callable) == IS_UNICODE) && ce) { zval_dtor(callable); array_init(callable); @@ -3137,8 +3147,9 @@ ZEND_API int zend_fcall_info_init(zval * zend_class_entry *ce; zend_function *func; zval **obj; + zend_uint fetch_type; - if (!zend_is_callable_ex(callable, check_flags, callable_name, &ce, &func, &obj, error TSRMLS_CC)) { + if (!zend_is_callable_ex(callable, check_flags, callable_name, &ce, &fetch_type, &func, &obj, error TSRMLS_CC)) { return FAILURE; } @@ -3162,7 +3173,11 @@ ZEND_API int zend_fcall_info_init(zval * } else { fcc->initialized = 1; fcc->function_handler = func; - fcc->calling_scope = ce; + if (fetch_type == ZEND_FETCH_CLASS_PARENT) { + fcc->calling_scope = EG(called_scope); + } else { + fcc->calling_scope = ce; + } fcc->object_pp = obj; } Index: Zend/zend_API.h =================================================================== RCS file: /repository/ZendEngine2/zend_API.h,v retrieving revision 1.301 diff -u -p -r1.301 zend_API.h --- Zend/zend_API.h 27 May 2008 10:28:25 -0000 1.301 +++ Zend/zend_API.h 24 Jun 2008 20:39:56 -0000 @@ -263,7 +263,7 @@ ZEND_API void zend_wrong_param_count(TSR #define IS_CALLABLE_STRICT (IS_CALLABLE_CHECK_IS_STATIC) -ZEND_API zend_bool zend_is_callable_ex(zval *callable, uint check_flags, zval *callable_name, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zval ***zobj_ptr_ptr, char **error TSRMLS_DC); +ZEND_API zend_bool zend_is_callable_ex(zval *callable, uint check_flags, zval *callable_name, zend_class_entry **ce_ptr, zend_uint *fetch_type, zend_function **fptr_ptr, zval ***zobj_ptr_ptr, char **error TSRMLS_DC); ZEND_API zend_bool zend_is_callable(zval *callable, uint check_flags, zval *callable_name); ZEND_API zend_bool zend_make_callable(zval *callable, zval *callable_name TSRMLS_DC); ZEND_API const char *zend_get_module_version(const char *module_name); Index: Zend/zend_execute_API.c =================================================================== RCS file: /repository/ZendEngine2/zend_execute_API.c,v retrieving revision 1.450 diff -u -p -r1.450 zend_execute_API.c --- Zend/zend_execute_API.c 5 Jun 2008 19:14:25 -0000 1.450 +++ Zend/zend_execute_API.c 24 Jun 2008 20:39:56 -0000 @@ -857,6 +857,7 @@ int zend_call_function(zend_fcall_info * found = (*ce != NULL?SUCCESS:FAILURE); fci->object_pp = EG(This)?&EG(This):NULL; EX(object) = EG(This); + calling_scope = *ce; } else { zend_class_entry *scope; scope = EG(active_op_array) ? EG(active_op_array)->scope : NULL; @@ -873,12 +874,12 @@ int zend_call_function(zend_fcall_info * } else { fci->object_pp = NULL; } + calling_scope = *ce; } if (found == FAILURE) return FAILURE; fci->function_table = &(*ce)->function_table; - calling_scope = *ce; } else { zend_error(E_NOTICE, "Non-callable array passed to zend_call_function()"); return FAILURE; Index: Zend/zend_vm_def.h =================================================================== RCS file: /repository/ZendEngine2/zend_vm_def.h,v retrieving revision 1.233 diff -u -p -r1.233 zend_vm_def.h --- Zend/zend_vm_def.h 11 Jun 2008 13:19:14 -0000 1.233 +++ Zend/zend_vm_def.h 24 Jun 2008 20:39:57 -0000 @@ -1991,8 +1991,15 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_ME if (!ce) { zend_error(E_ERROR, "Class '%R' not found", Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant)); } + EX(called_scope) = ce; } else { ce = EX_T(opline->op1.u.var).class_entry; + + if (opline->op1.u.EA.type == ZEND_FETCH_CLASS_PARENT) { + EX(called_scope) = EG(called_scope); + } else { + EX(called_scope) = ce; + } } if(OP2_TYPE != IS_UNUSED) { zstr function_name_strval; @@ -2037,8 +2044,6 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_ME EX(fbc) = ce->constructor; } - EX(called_scope) = ce; - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { EX(object) = NULL; } else { Index: Zend/zend_vm_execute.h =================================================================== RCS file: /repository/ZendEngine2/zend_vm_execute.h,v retrieving revision 1.237 diff -u -p -r1.237 zend_vm_execute.h --- Zend/zend_vm_execute.h 11 Jun 2008 13:19:14 -0000 1.237 +++ Zend/zend_vm_execute.h 24 Jun 2008 20:40:05 -0000 @@ -2647,8 +2647,15 @@ static int ZEND_FASTCALL ZEND_INIT_STATI if (!ce) { zend_error(E_ERROR, "Class '%R' not found", Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant)); } + EX(called_scope) = ce; } else { ce = EX_T(opline->op1.u.var).class_entry; + + if (opline->op1.u.EA.type == ZEND_FETCH_CLASS_PARENT) { + EX(called_scope) = EG(called_scope); + } else { + EX(called_scope) = ce; + } } if(IS_CONST != IS_UNUSED) { zstr function_name_strval; @@ -2693,8 +2700,6 @@ static int ZEND_FASTCALL ZEND_INIT_STATI EX(fbc) = ce->constructor; } - EX(called_scope) = ce; - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { EX(object) = NULL; } else { @@ -3228,8 +3233,15 @@ static int ZEND_FASTCALL ZEND_INIT_STATI if (!ce) { zend_error(E_ERROR, "Class '%R' not found", Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant)); } + EX(called_scope) = ce; } else { ce = EX_T(opline->op1.u.var).class_entry; + + if (opline->op1.u.EA.type == ZEND_FETCH_CLASS_PARENT) { + EX(called_scope) = EG(called_scope); + } else { + EX(called_scope) = ce; + } } if(IS_TMP_VAR != IS_UNUSED) { zstr function_name_strval; @@ -3274,8 +3286,6 @@ static int ZEND_FASTCALL ZEND_INIT_STATI EX(fbc) = ce->constructor; } - EX(called_scope) = ce; - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { EX(object) = NULL; } else { @@ -3700,8 +3710,15 @@ static int ZEND_FASTCALL ZEND_INIT_STATI if (!ce) { zend_error(E_ERROR, "Class '%R' not found", Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant)); } + EX(called_scope) = ce; } else { ce = EX_T(opline->op1.u.var).class_entry; + + if (opline->op1.u.EA.type == ZEND_FETCH_CLASS_PARENT) { + EX(called_scope) = EG(called_scope); + } else { + EX(called_scope) = ce; + } } if(IS_VAR != IS_UNUSED) { zstr function_name_strval; @@ -3746,8 +3763,6 @@ static int ZEND_FASTCALL ZEND_INIT_STATI EX(fbc) = ce->constructor; } - EX(called_scope) = ce; - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { EX(object) = NULL; } else { @@ -3928,8 +3943,15 @@ static int ZEND_FASTCALL ZEND_INIT_STATI if (!ce) { zend_error(E_ERROR, "Class '%R' not found", Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant)); } + EX(called_scope) = ce; } else { ce = EX_T(opline->op1.u.var).class_entry; + + if (opline->op1.u.EA.type == ZEND_FETCH_CLASS_PARENT) { + EX(called_scope) = EG(called_scope); + } else { + EX(called_scope) = ce; + } } if(IS_UNUSED != IS_UNUSED) { zstr function_name_strval; @@ -3974,8 +3996,6 @@ static int ZEND_FASTCALL ZEND_INIT_STATI EX(fbc) = ce->constructor; } - EX(called_scope) = ce; - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { EX(object) = NULL; } else { @@ -4368,8 +4388,15 @@ static int ZEND_FASTCALL ZEND_INIT_STATI if (!ce) { zend_error(E_ERROR, "Class '%R' not found", Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant)); } + EX(called_scope) = ce; } else { ce = EX_T(opline->op1.u.var).class_entry; + + if (opline->op1.u.EA.type == ZEND_FETCH_CLASS_PARENT) { + EX(called_scope) = EG(called_scope); + } else { + EX(called_scope) = ce; + } } if(IS_CV != IS_UNUSED) { zstr function_name_strval; @@ -4414,8 +4441,6 @@ static int ZEND_FASTCALL ZEND_INIT_STATI EX(fbc) = ce->constructor; } - EX(called_scope) = ce; - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { EX(object) = NULL; } else { @@ -10606,8 +10631,15 @@ static int ZEND_FASTCALL ZEND_INIT_STATI if (!ce) { zend_error(E_ERROR, "Class '%R' not found", Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant)); } + EX(called_scope) = ce; } else { ce = EX_T(opline->op1.u.var).class_entry; + + if (opline->op1.u.EA.type == ZEND_FETCH_CLASS_PARENT) { + EX(called_scope) = EG(called_scope); + } else { + EX(called_scope) = ce; + } } if(IS_CONST != IS_UNUSED) { zstr function_name_strval; @@ -10652,8 +10684,6 @@ static int ZEND_FASTCALL ZEND_INIT_STATI EX(fbc) = ce->constructor; } - EX(called_scope) = ce; - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { EX(object) = NULL; } else { @@ -12497,8 +12527,15 @@ static int ZEND_FASTCALL ZEND_INIT_STATI if (!ce) { zend_error(E_ERROR, "Class '%R' not found", Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant)); } + EX(called_scope) = ce; } else { ce = EX_T(opline->op1.u.var).class_entry; + + if (opline->op1.u.EA.type == ZEND_FETCH_CLASS_PARENT) { + EX(called_scope) = EG(called_scope); + } else { + EX(called_scope) = ce; + } } if(IS_TMP_VAR != IS_UNUSED) { zstr function_name_strval; @@ -12543,8 +12580,6 @@ static int ZEND_FASTCALL ZEND_INIT_STATI EX(fbc) = ce->constructor; } - EX(called_scope) = ce; - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { EX(object) = NULL; } else { @@ -14358,8 +14393,15 @@ static int ZEND_FASTCALL ZEND_INIT_STATI if (!ce) { zend_error(E_ERROR, "Class '%R' not found", Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant)); } + EX(called_scope) = ce; } else { ce = EX_T(opline->op1.u.var).class_entry; + + if (opline->op1.u.EA.type == ZEND_FETCH_CLASS_PARENT) { + EX(called_scope) = EG(called_scope); + } else { + EX(called_scope) = ce; + } } if(IS_VAR != IS_UNUSED) { zstr function_name_strval; @@ -14404,8 +14446,6 @@ static int ZEND_FASTCALL ZEND_INIT_STATI EX(fbc) = ce->constructor; } - EX(called_scope) = ce; - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { EX(object) = NULL; } else { @@ -15317,8 +15357,15 @@ static int ZEND_FASTCALL ZEND_INIT_STATI if (!ce) { zend_error(E_ERROR, "Class '%R' not found", Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant)); } + EX(called_scope) = ce; } else { ce = EX_T(opline->op1.u.var).class_entry; + + if (opline->op1.u.EA.type == ZEND_FETCH_CLASS_PARENT) { + EX(called_scope) = EG(called_scope); + } else { + EX(called_scope) = ce; + } } if(IS_UNUSED != IS_UNUSED) { zstr function_name_strval; @@ -15363,8 +15410,6 @@ static int ZEND_FASTCALL ZEND_INIT_STATI EX(fbc) = ce->constructor; } - EX(called_scope) = ce; - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { EX(object) = NULL; } else { @@ -16828,8 +16873,15 @@ static int ZEND_FASTCALL ZEND_INIT_STATI if (!ce) { zend_error(E_ERROR, "Class '%R' not found", Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant)); } + EX(called_scope) = ce; } else { ce = EX_T(opline->op1.u.var).class_entry; + + if (opline->op1.u.EA.type == ZEND_FETCH_CLASS_PARENT) { + EX(called_scope) = EG(called_scope); + } else { + EX(called_scope) = ce; + } } if(IS_CV != IS_UNUSED) { zstr function_name_strval; @@ -16874,8 +16926,6 @@ static int ZEND_FASTCALL ZEND_INIT_STATI EX(fbc) = ce->constructor; } - EX(called_scope) = ce; - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { EX(object) = NULL; } else { Index: Zend/tests/lsb_007.phpt =================================================================== RCS file: /repository/ZendEngine2/tests/lsb_007.phpt,v retrieving revision 1.4 diff -u -p -r1.4 lsb_007.phpt --- Zend/tests/lsb_007.phpt 26 May 2008 14:33:43 -0000 1.4 +++ Zend/tests/lsb_007.phpt 24 Jun 2008 20:40:05 -0000 @@ -9,4 +9,4 @@ class Foo implements static { ?> ==DONE== --EXPECTF-- -Parse error: parse error, expecting `T_STRING' or `T_PAAMAYIM_NEKUDOTAYIM' or `T_NAMESPACE' in %slsb_007.php on line %d \ No newline at end of file +Parse error: syntax error, unexpected T_STATIC, expecting T_STRING or T_PAAMAYIM_NEKUDOTAYIM or T_NAMESPACE in %s%elsb_007.php on line %d Index: Zend/tests/lsb_008.phpt =================================================================== RCS file: /repository/ZendEngine2/tests/lsb_008.phpt,v retrieving revision 1.2 diff -u -p -r1.2 lsb_008.phpt --- Zend/tests/lsb_008.phpt 26 May 2008 14:33:43 -0000 1.2 +++ Zend/tests/lsb_008.phpt 24 Jun 2008 20:40:05 -0000 @@ -5,4 +5,4 @@ ZE2 Late Static Binding class name "stat class static { } --EXPECTF-- -Parse error: parse error, expecting `T_STRING' in %slsb_008.php on line %d +Parse error: syntax error, unexpected T_STATIC, expecting T_STRING in %s%elsb_008.php on line %d Index: Zend/tests/lsb_009.phpt =================================================================== RCS file: /repository/ZendEngine2/tests/lsb_009.phpt,v retrieving revision 1.2 diff -u -p -r1.2 lsb_009.phpt --- Zend/tests/lsb_009.phpt 26 May 2008 14:33:43 -0000 1.2 +++ Zend/tests/lsb_009.phpt 24 Jun 2008 20:40:05 -0000 @@ -5,4 +5,4 @@ ZE2 Late Static Binding interface name " interface static { } --EXPECTF-- -Parse error: parse error, expecting `T_STRING' in %slsb_009.php on line %d +Parse error: syntax error, unexpected T_STATIC, expecting T_STRING in %s%elsb_009.php on line %d Index: Zend/tests/lsb_019.phpt =================================================================== RCS file: /repository/ZendEngine2/tests/lsb_019.phpt,v retrieving revision 1.2 diff -u -p -r1.2 lsb_019.phpt --- Zend/tests/lsb_019.phpt 26 May 2008 14:33:43 -0000 1.2 +++ Zend/tests/lsb_019.phpt 24 Jun 2008 20:40:05 -0000 @@ -1,5 +1,5 @@ --TEST-- -Test LSB of properties and methods declared as protected and overridden as public. +ZE2 Late Static Binding properties and methods declared as protected and overridden as public. --FILE-- +--EXPECTF-- +C +C +C +A +A +A Index: ext/standard/tests/class_object/forward_static_call_001.phpt =================================================================== RCS file: ext/standard/tests/class_object/forward_static_call_001.phpt diff -N ext/standard/tests/class_object/forward_static_call_001.phpt --- ext/standard/tests/class_object/forward_static_call_001.phpt 26 May 2008 23:45:15 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,83 +0,0 @@ ---TEST-- -forward_static_call() called from outside of a method. ---FILE-- - -===DONE=== ---EXPECT-- -A -- -B -B -- -B -B -B -- -B -B -- -C -C -- -B -B -C -- -B -C -===DONE=== Index: ext/standard/tests/class_object/forward_static_call_002.phpt =================================================================== RCS file: ext/standard/tests/class_object/forward_static_call_002.phpt diff -N ext/standard/tests/class_object/forward_static_call_002.phpt --- ext/standard/tests/class_object/forward_static_call_002.phpt 7 Apr 2008 10:39:43 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,21 +0,0 @@ ---TEST-- -forward_static_call() from outside of a class method. ---FILE-- - ---EXPECTF-- -Fatal error: Cannot call forward_static_call() when no class scope is active in %s on line %d Index: ext/standard/tests/class_object/forward_static_call_003.phpt =================================================================== RCS file: ext/standard/tests/class_object/forward_static_call_003.phpt diff -N ext/standard/tests/class_object/forward_static_call_003.phpt --- ext/standard/tests/class_object/forward_static_call_003.phpt 26 May 2008 23:45:15 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,51 +0,0 @@ ---TEST-- -forward_static_call() calling outside of the inheritance chain. ---FILE-- - -===DONE=== ---EXPECT-- -A -- -B -B -- -C -B -B -===DONE===