Fixed bug #72846 (getConstant for a array constant with constant values returns NULL/NFC/UKNOWN)

This commit is contained in:
Xinchen Hui 2016-08-15 23:22:55 +08:00
parent d6b46901b2
commit 60de74ebda
3 changed files with 54 additions and 0 deletions

View file

@ -4407,6 +4407,7 @@ ZEND_METHOD(reflection_class, getConstants)
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;
}
@ -4431,6 +4432,7 @@ ZEND_METHOD(reflection_class, getConstant)
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;
}