From d2ca448f0743b78007b4b40b04051a62b860236e Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Fri, 3 Feb 2012 16:27:35 +0000 Subject: [PATCH] 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 0cf44aa4d75..43dfe1329ef 100644 --- a/NEWS +++ b/NEWS @@ -35,4 +35,8 @@ PHP NEWS - pgsql . Added pg_escape_literal() and pg_escape_identifier() (Yasuo) +- Reflection: + . Fixed bug #60968 (Late static binding doesn't work with + ReflectionMethod::invokeArgs()). (Laruence) + <<< NOTE: Insert NEWS from last stable release here prior to actual release! >>> diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 663eb405ded..b5ea8386c5c 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 31e8a2e9475..5c4a0989797 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