diff options
| author | Ondřej Surý <ondrej@sury.org> | 2012-01-11 15:43:42 +0100 |
|---|---|---|
| committer | Ondřej Surý <ondrej@sury.org> | 2012-01-11 15:43:42 +0100 |
| commit | 8f1428d29ef91d74b4d272af171675f2971eb15b (patch) | |
| tree | a1f4f4d7dc5bfe8096806dd5c5266634e19fa07a /ext/reflection | |
| parent | c6e4182351e0173fe58de141e143aac2eacf5efe (diff) | |
| download | php-upstream/5.3.9.tar.gz | |
Imported Upstream version 5.3.9upstream/5.3.9
Diffstat (limited to 'ext/reflection')
| -rw-r--r-- | ext/reflection/php_reflection.c | 10 | ||||
| -rw-r--r-- | ext/reflection/php_reflection.h | 4 | ||||
| -rw-r--r-- | ext/reflection/tests/bug60367.phpt | 26 |
3 files changed, 33 insertions, 7 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index a4d8cb71d..a73b67026 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_reflection.c 313665 2011-07-25 11:42:53Z felipe $ */ +/* $Id: php_reflection.c 321634 2012-01-01 13:15:04Z felipe $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -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); @@ -5545,7 +5545,7 @@ PHP_MINFO_FUNCTION(reflection) /* {{{ */ php_info_print_table_start(); php_info_print_table_header(2, "Reflection", "enabled"); - php_info_print_table_row(2, "Version", "$Revision: 313665 $"); + php_info_print_table_row(2, "Version", "$Revision: 321634 $"); php_info_print_table_end(); } /* }}} */ @@ -5559,7 +5559,7 @@ zend_module_entry reflection_module_entry = { /* {{{ */ NULL, NULL, PHP_MINFO(reflection), - "$Revision: 313665 $", + "$Revision: 321634 $", STANDARD_MODULE_PROPERTIES }; /* }}} */ diff --git a/ext/reflection/php_reflection.h b/ext/reflection/php_reflection.h index 0607f7f64..71bacaae4 100644 --- a/ext/reflection/php_reflection.h +++ b/ext/reflection/php_reflection.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_reflection.h 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: php_reflection.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef PHP_REFLECTION_H #define PHP_REFLECTION_H diff --git a/ext/reflection/tests/bug60367.phpt b/ext/reflection/tests/bug60367.phpt new file mode 100644 index 000000000..31e8a2e94 --- /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 |
