[php-src] master: Implement `ReflectionClassConstant::isDeprecated()` 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/22f80dcf9932035bacbde7fc61712373ff72bdb0
Raw diff: https://github.com/php/php-src/commit/22f80dcf9932035bacbde7fc61712373ff72bdb0.diff

Implement `ReflectionClassConstant::isDeprecated()` 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 8e3113f7a6ec..f25cd09e067f 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -4050,14 +4050,7 @@ ZEND_METHOD(ReflectionClassConstant, isEnumCase)
 
 ZEND_METHOD(ReflectionClassConstant, isDeprecated)
 {
-	reflection_object *intern;
-	zend_constant *ref;
-
-	ZEND_PARSE_PARAMETERS_NONE();
-
-	GET_REFLECTION_OBJECT_PTR(ref);
-
-	RETURN_BOOL(ZEND_CLASS_CONST_FLAGS(ref) & ZEND_ACC_DEPRECATED);
+	_class_constant_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_DEPRECATED);
 }
 
 /* {{{ reflection_class_object_ctor */
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.