specifying a sequence). (Pablo Santiago Sánchez, Matteo)
. Fixed bug #72759 (Regression in pgo_pgsql). (Anatol)
+- Reflection:
+ . Fixed bug #72846 (getConstant for a array constant with constant values
+ returns NULL/NFC/UKNOWN). (Laruence)
+
- Session:
. Fixed bug #72724 (PHP7: session-uploadprogress kills httpd). (Nikita)
GET_REFLECTION_OBJECT_PTR(ce);
array_init(return_value);
ZEND_HASH_FOREACH_VAL(&ce->constants_table, val) {
+ ZVAL_DEREF(val);
if (UNEXPECTED(zval_update_constant_ex(val, 1, ce) != SUCCESS)) {
return;
}
GET_REFLECTION_OBJECT_PTR(ce);
ZEND_HASH_FOREACH_VAL(&ce->constants_table, value) {
+ ZVAL_DEREF(value);
if (UNEXPECTED(zval_update_constant_ex(value, 1, ce) != SUCCESS)) {
return;
}
--- /dev/null
+--TEST--
+Bug #72846 (getConstant for a array constant with constant values returns NULL/NFC/UKNOWN)
+--FILE--
+<?php
+
+namespace Some {
+
+ abstract class A
+ {
+ const ONE = '1';
+ const TWO = '2';
+
+ const CONST_NUMBERS = [
+ self::ONE,
+ self::TWO,
+ ];
+
+ const NUMBERS = [
+ '1',
+ '2',
+ ];
+ }
+
+ class B extends A
+ {
+ }
+
+ $ref = new \ReflectionClass('Some\B');
+
+ var_dump($ref->getConstant('ONE'));
+ var_dump($ref->getConstant('CONST_NUMBERS'));
+ var_dump($ref->getConstant('NUMBERS'));
+}
+?>
+--EXPECT--
+string(1) "1"
+array(2) {
+ [0]=>
+ string(1) "1"
+ [1]=>
+ string(1) "2"
+}
+array(2) {
+ [0]=>
+ string(1) "1"
+ [1]=>
+ string(1) "2"
+}