Commit: df3b9a1e0791803b1d9f9300d8f36dd981126bc7 Author: Xinchen Hui <larue...@php.net> Tue, 27 Nov 2012 13:34:36 +0800 Parents: 92147243bf082b9d05c1b2949c35637c8fbd0dd9 Branches: PHP-5.3
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=df3b9a1e0791803b1d9f9300d8f36dd981126bc7 Log: Fixed Bug #63614 (Fatal error on Reflection) Bugs: https://bugs.php.net/63614 Changed paths: M NEWS M ext/reflection/php_reflection.c A ext/reflection/tests/bug63614.phpt Diff: diff --git a/NEWS b/NEWS index 06f5a25..dc1b8a1 100644 --- a/NEWS +++ b/NEWS @@ -7,17 +7,24 @@ PHP NEWS from value). (Pierrick) . Fixed bug #63468 (wrong called method as callback with inheritance). (Laruence) + - Core: . Fixed bug #63451 (config.guess file does not have AIX 7 defined, shared objects are not created). (kemcline at au1 dot ibm dot com) + - Apache2 Handler SAPI: . Enabled Apache 2.4 configure option for Windows (Pierre, Anatoliy) + - Fileinfo: . Fixed bug #63248 (Load multiple magic files from a directory under Windows). (Anatoliy) + - Imap: . Fixed Bug #63126 DISABLE_AUTHENTICATOR ignores array (Remi) +- Reflection: + . Fixed Bug #63614 (Fatal error on Reflection). (Laruence) + 22 Nov 2012, PHP 5.3.19 diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 593a050..8b8b886 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -1733,7 +1733,7 @@ ZEND_METHOD(reflection_function, getStaticVariables) /* Return an empty array in case no static variables exist */ array_init(return_value); if (fptr->type == ZEND_USER_FUNCTION && fptr->op_array.static_variables != NULL) { - zend_hash_apply_with_argument(fptr->op_array.static_variables, (apply_func_arg_t) zval_update_constant, (void*)1 TSRMLS_CC); + zend_hash_apply_with_argument(fptr->op_array.static_variables, (apply_func_arg_t) zval_update_constant_inline_change, fptr->common.scope TSRMLS_CC); zend_hash_copy(Z_ARRVAL_P(return_value), fptr->op_array.static_variables, (copy_ctor_func_t) zval_add_ref, (void *) &tmp_copy, sizeof(zval *)); } } diff --git a/ext/reflection/tests/bug63614.phpt b/ext/reflection/tests/bug63614.phpt new file mode 100644 index 0000000..c13ff4b --- /dev/null +++ b/ext/reflection/tests/bug63614.phpt @@ -0,0 +1,41 @@ +--TEST-- +Bug #63614 (Fatal error on Reflection) +--FILE-- +<?php +function dummy() { + static $a = array(); +} + +class Test +{ + const A = 0; + + public function func() + { + static $a = array( + self::A => 'a' + ); + } +} + +$reflect = new ReflectionFunction("dummy"); +print_r($reflect->getStaticVariables()); +$reflect = new ReflectionMethod('Test', 'func'); +print_r($reflect->getStaticVariables()); +?> +--EXPECT-- +Array +( + [a] => Array + ( + ) + +) +Array +( + [a] => Array + ( + [0] => a + ) + +) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php