From e83f0261c07834918fcaf6b941bcbddbd0905f4b Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Fri, 2 Mar 2012 03:36:30 +0000 Subject: [PATCH] MFH: Fixed bug #60968 (Late static binding doesn't work with ReflectionMethod::invokeArgs()) --- NEWS | 4 ++++ ext/reflection/php_reflection.c | 2 +- ext/reflection/tests/bug60367.phpt | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) 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 -- 2.40.0