Index: Zend/zend_API.c =================================================================== RCS file: /repository/ZendEngine2/zend_API.c,v retrieving revision 1.433 diff -u -r1.433 zend_API.c --- Zend/zend_API.c 16 May 2007 18:56:38 -0000 1.433 +++ Zend/zend_API.c 27 May 2007 15:31:44 -0000 @@ -2561,7 +2561,11 @@ } } if (colon.v != NULL) { + zend_class_entry *last_scope = EG(scope); + EG(scope) = ce_org; *ce_ptr = zend_u_fetch_class(Z_TYPE_P(callable), Z_UNIVAL_P(callable), clen, ZEND_FETCH_CLASS_AUTO TSRMLS_CC); + EG(scope) = last_scope; + if (!*ce_ptr) { return 0; } 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 27 May 2007 15:31:44 -0000 @@ -0,0 +1,55 @@ +--TEST-- +ZE2 Callbacks of static functions +--FILE-- +foo(); +?> +===DONE=== +--EXPECT-- +B +B +A +D +A +A +B +===DONE===