mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
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.
This commit is contained in:
parent
2e854791af
commit
82f9e004da
3 changed files with 3 additions and 4 deletions
|
@ -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) {
|
||||
|
|
|
@ -259,7 +259,7 @@ class ReflectionClass implements Reflector
|
|||
/** @return bool */
|
||||
public function hasConstant(string $name) {}
|
||||
|
||||
/** @return array|null */
|
||||
/** @return array */
|
||||
public function getConstants(?int $filter = null) {}
|
||||
|
||||
/** @return ReflectionClassConstant[] */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* This is a generated file, edit the .stub.php file instead.
|
||||
* Stub hash: ec7607b8087ddd4297bf51cc4072465d2a0f27af */
|
||||
* Stub hash: 6849bff1f2b343df4bd7e6da9c8adc555731e2d3 */
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Reflection_getModifierNames, 0, 0, 1)
|
||||
ZEND_ARG_TYPE_INFO(0, modifiers, IS_LONG, 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue