From e0137255164d3eb544efd9737ebb5f76477e7f33 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Thu, 24 Nov 2011 09:16:11 +0000 Subject: [PATCH] Fixed bug #60367 (Reflection and Late Static Binding) --- ext/reflection/php_reflection.c | 2 +- ext/reflection/tests/bug60367.phpt | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 ext/reflection/tests/bug60367.phpt diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 1e0386a601..754be1483c 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -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); diff --git a/ext/reflection/tests/bug60367.phpt b/ext/reflection/tests/bug60367.phpt new file mode 100644 index 0000000000..31e8a2e947 --- /dev/null +++ b/ext/reflection/tests/bug60367.phpt @@ -0,0 +1,26 @@ +--TEST-- +Bug #60367 (Reflection and Late Static Binding) +--FILE-- +invoke(null); +$method = new ReflectionMethod("A::call"); +$method->invoke(null); +--EXPECTF-- +BA -- 2.50.1