diff options
| author | Xinchen Hui <laruence@php.net> | 2011-11-24 09:16:11 +0000 |
|---|---|---|
| committer | Xinchen Hui <laruence@php.net> | 2011-11-24 09:16:11 +0000 |
| commit | fe96e8e64ca1e3b9045a8d2af21ed91448c31594 (patch) | |
| tree | dcb46ead6de104364bb80451632e60db69394a48 | |
| parent | 0f799cc4104513272c81eb3f30f8e238ee2891e3 (diff) | |
| download | php-git-fe96e8e64ca1e3b9045a8d2af21ed91448c31594.tar.gz | |
Fixed bug #60367 (Reflection and Late Static Binding)
| -rw-r--r-- | NEWS | 3 | ||||
| -rw-r--r-- | ext/reflection/php_reflection.c | 2 | ||||
| -rw-r--r-- | ext/reflection/tests/bug60367.phpt | 26 |
3 files changed, 30 insertions, 1 deletions
@@ -75,6 +75,9 @@ PHP NEWS . Fixed bug #54682 (Tidy::diagnose() NULL pointer dereference). (Maksymilian Arciemowicz, Felipe) +- Reflection: + . Fixed bug #60367 (Reflection and Late Static Binding). (Laruence) + 03 Nov 2011, PHP 5.3.9RC1 - Core: diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index caeabb6d6e..580e0a6410 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -2635,7 +2635,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-- +<?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 |
