Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'PHP-5.3' into PHP-5.4

  • Loading branch information...
commit 070239a19447c2737bc4fddbcce00c2e16f362d0 2 parents 7751a68 + df3b9a1
Xinchen Hui authored November 27, 2012
3  NEWS
@@ -23,6 +23,9 @@ PHP                                                                        NEWS
23 23
 - Apache2 Handler SAPI:
24 24
   . Enabled Apache 2.4 configure option for Windows (Pierre, Anatoliy)
25 25
 
  26
+- Reflection:
  27
+  . Fixed Bug #63614 (Fatal error on Reflection). (Laruence)
  28
+
26 29
 22 Nov 2012, PHP 5.4.9
27 30
 
28 31
 - Core:
2  ext/reflection/php_reflection.c
@@ -1884,7 +1884,7 @@ ZEND_METHOD(reflection_function, getStaticVariables)
1884 1884
 	/* Return an empty array in case no static variables exist */
1885 1885
 	array_init(return_value);
1886 1886
 	if (fptr->type == ZEND_USER_FUNCTION && fptr->op_array.static_variables != NULL) {
1887  
-		zend_hash_apply_with_argument(fptr->op_array.static_variables, (apply_func_arg_t) zval_update_constant, (void*)1 TSRMLS_CC);
  1887
+		zend_hash_apply_with_argument(fptr->op_array.static_variables, (apply_func_arg_t) zval_update_constant_inline_change, fptr->common.scope TSRMLS_CC);
1888 1888
 		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 *));
1889 1889
 	}
1890 1890
 }
41  ext/reflection/tests/bug63614.phpt
... ...
@@ -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 notes on commit 070239a

Please sign in to comment.
Something went wrong with that request. Please try again.