PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 200?, PHP 5.3.0 RC 2
+- Fixed bug #47699 (autoload and late static binding). (Dmitry)
- Fixed bug #44409 (PDO::FETCH_SERIALIZE calls __construct()).
(matteo at beccati dot com)
- Fixed bug #42362 - (HTTP status codes 204 and 304 should not be gzipped).
--- /dev/null
+--TEST--
+Bug #47699 (autoload and late static binding)
+--FILE--
+<?php
+class A {
+ static function test($v='') {
+ print_r(get_called_class());
+ }
+}
+class B extends A {
+}
+B::test();
+spl_autoload_register('B::test');
+new X();
+?>
+--EXPECTF--
+BB
+Fatal error: Class 'X' not found in %sbug47699.php on line %d
fcic.function_handler = *fn_proxy;
}
fcic.calling_scope = obj_ce;
- fcic.called_scope = object_pp ? obj_ce : EG(called_scope);
+ if (object_pp) {
+ fcic.called_scope = Z_OBJCE_PP(object_pp);
+ } else if (obj_ce &&
+ !(EG(called_scope) &&
+ instanceof_function(EG(called_scope), obj_ce TSRMLS_CC))) {
+ fcic.called_scope = obj_ce;
+ } else {
+ fcic.called_scope = EG(called_scope);
+ }
fcic.object_ptr = object_pp ? *object_pp : NULL;
result = zend_call_function(&fci, &fcic TSRMLS_CC);
}