From: Xinchen Hui Date: Fri, 2 Mar 2012 03:36:30 +0000 (+0000) Subject: MFH: Fixed bug #60968 (Late static binding doesn't work with ReflectionMethod::invoke... X-Git-Tag: PHP-5.4.1-RC1~110 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e83f0261c07834918fcaf6b941bcbddbd0905f4b;p=php MFH: Fixed bug #60968 (Late static binding doesn't work with ReflectionMethod::invokeArgs()) --- diff --git a/NEWS b/NEWS index 73d26e4c09..d8fd8fc981 100644 --- a/NEWS +++ b/NEWS @@ -22,6 +22,10 @@ PHP NEWS - Installation . Fixed bug #61172 (Add Apache 2.4 support). (Chris Jones) +- Reflection: + . Fixed bug #60968 (Late static binding doesn't work with + ReflectionMethod::invokeArgs()). (Laruence) + 01 Mar 2012, PHP 5.4.0 - Installation: diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 663eb405de..b5ea8386c5 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -2920,7 +2920,7 @@ ZEND_METHOD(reflection_method, invokeArgs) 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; result = zend_call_function(&fci, &fcc TSRMLS_CC); diff --git a/ext/reflection/tests/bug60367.phpt b/ext/reflection/tests/bug60367.phpt index 31e8a2e947..5c4a098979 100644 --- a/ext/reflection/tests/bug60367.phpt +++ b/ext/reflection/tests/bug60367.phpt @@ -20,7 +20,9 @@ class B extends A { $method = new ReflectionMethod("b::call"); $method->invoke(null); +$method->invokeArgs(null, array()); $method = new ReflectionMethod("A::call"); $method->invoke(null); +$method->invokeArgs(null, array()); --EXPECTF-- -BA +BBAA