Commit eeb02a0f140 for php.net
commit eeb02a0f14033ace9ac766028b14c29cda5e1cca
Author: Arshid <arshidkv12@gmail.com>
Date: Thu Jun 25 13:33:35 2026 +0530
ext/Reflection: Simplify ReflectionClass::hasConstant() (#22438)
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index a208741b159..f5b1cb2010a 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -4762,11 +4762,7 @@ ZEND_METHOD(ReflectionClass, hasConstant)
}
GET_REFLECTION_OBJECT_PTR(ce);
- if (zend_hash_exists(&ce->constants_table, name)) {
- RETURN_TRUE;
- } else {
- RETURN_FALSE;
- }
+ RETURN_BOOL(zend_hash_exists(&ce->constants_table, name));
}
/* }}} */