php8.5
Home/ Manual/ reflection / reflectionconstant/ ReflectionConstant::isDeprecated

ReflectionConstant::isDeprecated

PHP function Edit on GitHub ✎

(PHP 8 >= 8.4.0)

Checks if deprecated

Description

ReflectionConstant::isDeprecated(): bool

Checks whether the constant is deprecated.

Parameters Parameters

Return Values

true if it's deprecated, otherwise false

Examples

ReflectionConstant::isDeprecated example

php
<?php
// E_STRICT is deprecated as of PHP 8.4
var_dump((new ReflectionConstant('E_STRICT'))->isDeprecated());
?>

84

output
bool(true)

Source: reference/reflection/reflectionconstant/isdeprecated.xml · from the official PHP manual (php/doc-en)