Index: ext/standard/tests/general_functions/callbacks_001.phpt =================================================================== RCS file: ext/standard/tests/general_functions/callbacks_001.phpt diff -N ext/standard/tests/general_functions/callbacks_001.phpt --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ ext/standard/tests/general_functions/callbacks_001.phpt 30 May 2007 20:45:32 -0000 @@ -0,0 +1,55 @@ +--TEST-- +ZE2 Callbacks of static functions +--FILE-- +foo(); +?> +===DONE=== +--EXPECT-- +B +B +A +D +A +A +B +===DONE=== Index: Zend/zend_API.c =================================================================== RCS file: /repository/ZendEngine2/zend_API.c,v retrieving revision 1.296.2.27.2.30 diff -u -r1.296.2.27.2.30 zend_API.c --- Zend/zend_API.c 16 May 2007 18:57:15 -0000 1.296.2.27.2.30 +++ Zend/zend_API.c 30 May 2007 20:45:34 -0000 @@ -2116,7 +2116,6 @@ zend_function *fptr; zend_class_entry **pce; HashTable *ftable; - *ce_ptr = NULL; *fptr_ptr = NULL; @@ -2126,9 +2125,9 @@ lcname = zend_str_tolower_dup(Z_STRVAL_P(callable), clen); /* caution: lcname is not '\0' terminated */ if (clen == sizeof("self") - 1 && memcmp(lcname, "self", sizeof("self") - 1) == 0) { - *ce_ptr = EG(scope); - } else if (clen == sizeof("parent") - 1 && memcmp(lcname, "parent", sizeof("parent") - 1) == 0 && EG(active_op_array)->scope) { - *ce_ptr = EG(scope) ? EG(scope)->parent : NULL; + *ce_ptr = ce_org; + } else if (clen == sizeof("parent") - 1 && memcmp(lcname, "parent", sizeof("parent") - 1) == 0) { + *ce_ptr = ce_org ? ce_org->parent : NULL; } else if (zend_lookup_class(Z_STRVAL_P(callable), clen, &pce TSRMLS_CC) == SUCCESS) { *ce_ptr = *pce; } Index: Zend/zend_execute_API.c =================================================================== RCS file: /repository/ZendEngine2/zend_execute_API.c,v retrieving revision 1.331.2.20.2.19 diff -u -r1.331.2.20.2.19 zend_execute_API.c --- Zend/zend_execute_API.c 27 Apr 2007 08:12:24 -0000 1.331.2.20.2.19 +++ Zend/zend_execute_API.c 30 May 2007 20:45:34 -0000 @@ -758,9 +758,9 @@ /* caution: lcname is not '\0' terminated */ if (calling_scope) { if (clen == sizeof("self") - 1 && memcmp(lcname, "self", sizeof("self") - 1) == 0) { - ce_child = EG(active_op_array) ? EG(active_op_array)->scope : NULL; - } else if (clen == sizeof("parent") - 1 && memcmp(lcname, "parent", sizeof("parent") - 1) == 0 && EG(active_op_array)->scope) { - ce_child = EG(active_op_array) && EG(active_op_array)->scope ? EG(scope)->parent : NULL; + ce_child = calling_scope; + } else if (clen == sizeof("parent") - 1 && memcmp(lcname, "parent", sizeof("parent") - 1) == 0) { + ce_child = calling_scope->parent; } } efree(lcname);