Fixed bug #60367 (Reflection and Late Static Binding)

This commit is contained in:
Xinchen Hui 2011-11-24 09:16:11 +00:00
parent c05614fb6d
commit 3db55c8233
3 changed files with 28 additions and 1 deletions

1
NEWS
View File

@ -66,6 +66,7 @@ PHP NEWS
- Reflection:
. Fixed bug #60357 (__toString() method triggers E_NOTICE "Array to string
conversion"). (Laruence)
. Fixed bug #60367 (Reflection and Late Static Binding). (Laruence)
- SOAP extension:
. Added new SoapClient option "keep_alive". FR #60329. (Pierrick)

View File

@ -2811,7 +2811,7 @@ ZEND_METHOD(reflection_method, invoke)
fcc.initialized = 1;
fcc.function_handler = mptr;
fcc.calling_scope = obj_ce;
fcc.called_scope = obj_ce;
fcc.called_scope = intern->ce;
fcc.object_ptr = object_ptr;
result = zend_call_function(&fci, &fcc TSRMLS_CC);

View File

@ -0,0 +1,26 @@
--TEST--
Bug #60367 (Reflection and Late Static Binding)
--FILE--
<?php
abstract class A {
const WHAT = 'A';
public static function call() {
echo static::WHAT;
}
}
class B extends A {
const WHAT = 'B';
}
$method = new ReflectionMethod("b::call");
$method->invoke(null);
$method = new ReflectionMethod("A::call");
$method->invoke(null);
--EXPECTF--
BA