diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2020-12-31 19:36:27 +0100 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2021-01-01 14:46:28 +0100 |
commit | 82f9e004da91311dbe94e9a867f7fd6e4574adec (patch) | |
tree | c085c9d01dae8062249dcdef8244653d376050fe /ext/reflection/php_reflection.c | |
parent | 2e854791afa6bbe1c93705047c82630f49f64325 (diff) | |
download | php-git-82f9e004da91311dbe94e9a867f7fd6e4574adec.tar.gz |
Fix ReflectionClass::getConstants() stub
If `zval_update_constant_ex()` fails, an exception has already been
thrown, so we clarify that in the implementation as well.
Closes GH-6557.
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index dfa084caa5..a782a3ef0f 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -4446,8 +4446,7 @@ ZEND_METHOD(ReflectionClass, getConstants) array_init(return_value); ZEND_HASH_FOREACH_STR_KEY_PTR(&ce->constants_table, key, constant) { if (UNEXPECTED(zval_update_constant_ex(&constant->value, ce) != SUCCESS)) { - zend_array_destroy(Z_ARRVAL_P(return_value)); - RETURN_NULL(); + RETURN_THROWS(); } if (Z_ACCESS_FLAGS(constant->value) & filter) { |