summaryrefslogtreecommitdiff
path: root/ext/reflection
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2012-11-27 13:37:50 +0800
committerXinchen Hui <laruence@php.net>2012-11-27 13:37:50 +0800
commit8337c966562ef2282b6565a0c749ff78fa911cd4 (patch)
tree55d4b8cff09de397a8ea51aded3438a2fffcc079 /ext/reflection
parent495ff0964d6c24f04f1d705334bb3a5ce49ea8cb (diff)
parent070239a19447c2737bc4fddbcce00c2e16f362d0 (diff)
downloadphp-git-8337c966562ef2282b6565a0c749ff78fa911cd4.tar.gz
Merge branch 'PHP-5.4' into PHP-5.5
Diffstat (limited to 'ext/reflection')
-rw-r--r--ext/reflection/php_reflection.c2
-rw-r--r--ext/reflection/tests/bug63614.phpt41
2 files changed, 42 insertions, 1 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 7c51cf6cca..fb496936c2 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -1884,7 +1884,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 0000000000..c13ff4b20e
--- /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
+ )
+
+)