Skip to content

Commit df3b9a1

Browse files
committed
Fixed Bug #63614 (Fatal error on Reflection)
1 parent 9214724 commit df3b9a1

File tree

3 files changed

+49
-1
lines changed

3 files changed

+49
-1
lines changed

NEWS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,24 @@ PHP NEWS
77
from value). (Pierrick)
88
. Fixed bug #63468 (wrong called method as callback with inheritance).
99
(Laruence)
10+
1011
- Core:
1112
. Fixed bug #63451 (config.guess file does not have AIX 7 defined,
1213
shared objects are not created). (kemcline at au1 dot ibm dot com)
14+
1315
- Apache2 Handler SAPI:
1416
. Enabled Apache 2.4 configure option for Windows (Pierre, Anatoliy)
17+
1518
- Fileinfo:
1619
. Fixed bug #63248 (Load multiple magic files from a directory under Windows).
1720
(Anatoliy)
21+
1822
- Imap:
1923
. Fixed Bug #63126 DISABLE_AUTHENTICATOR ignores array (Remi)
2024

25+
- Reflection:
26+
. Fixed Bug #63614 (Fatal error on Reflection). (Laruence)
27+
2128

2229
22 Nov 2012, PHP 5.3.19
2330

ext/reflection/php_reflection.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1733,7 +1733,7 @@ ZEND_METHOD(reflection_function, getStaticVariables)
17331733
/* Return an empty array in case no static variables exist */
17341734
array_init(return_value);
17351735
if (fptr->type == ZEND_USER_FUNCTION && fptr->op_array.static_variables != NULL) {
1736-
zend_hash_apply_with_argument(fptr->op_array.static_variables, (apply_func_arg_t) zval_update_constant, (void*)1 TSRMLS_CC);
1736+
zend_hash_apply_with_argument(fptr->op_array.static_variables, (apply_func_arg_t) zval_update_constant_inline_change, fptr->common.scope TSRMLS_CC);
17371737
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 *));
17381738
}
17391739
}

ext/reflection/tests/bug63614.phpt

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
--TEST--
2+
Bug #63614 (Fatal error on Reflection)
3+
--FILE--
4+
<?php
5+
function dummy() {
6+
static $a = array();
7+
}
8+
9+
class Test
10+
{
11+
const A = 0;
12+
13+
public function func()
14+
{
15+
static $a = array(
16+
self::A => 'a'
17+
);
18+
}
19+
}
20+
21+
$reflect = new ReflectionFunction("dummy");
22+
print_r($reflect->getStaticVariables());
23+
$reflect = new ReflectionMethod('Test', 'func');
24+
print_r($reflect->getStaticVariables());
25+
?>
26+
--EXPECT--
27+
Array
28+
(
29+
[a] => Array
30+
(
31+
)
32+
33+
)
34+
Array
35+
(
36+
[a] => Array
37+
(
38+
[0] => a
39+
)
40+
41+
)

0 commit comments

Comments
 (0)