[php-src] master: Implement `ReflectionClassConstant::isEnumCase()` using existing helper

Daniel Scherzer <[email protected]>
Newsgroups gmane.comp.php.cvs.general
Message-ID <[email protected]>
Author: Daniel Scherzer (DanielEScherzer)
Date: 2026-07-07T10:33:39-07:00

Commit: https://github.com/php/php-src/commit/f98ebbf5423676fd65d4215e4bbc0994b5d1f5c6
Raw diff: https://github.com/php/php-src/commit/f98ebbf5423676fd65d4215e4bbc0994b5d1f5c6.diff

Implement `ReflectionClassConstant::isEnumCase()` using existing helper

Use the `_class_constant_check_flag()` helper function to simplify things

Changed paths:
  M  ext/reflection/php_reflection.c


Diff:

diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index bfff775cc43e..8e3113f7a6ec 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -4045,12 +4045,7 @@ ZEND_METHOD(ReflectionClassConstant, getAttributes)
 
 ZEND_METHOD(ReflectionClassConstant, isEnumCase)
 {
-	reflection_object *intern;
-	zend_class_constant *ref;
-
-	GET_REFLECTION_OBJECT_PTR(ref);
-
-	RETURN_BOOL(ZEND_CLASS_CONST_FLAGS(ref) & ZEND_CLASS_CONST_IS_CASE);
+	_class_constant_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_CLASS_CONST_IS_CASE);
 }
 
 ZEND_METHOD(ReflectionClassConstant, isDeprecated)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.