update pague now
PHP 8.5.2 Released!

ReflectionClassConstant::isDeprecated

(PHP 8 >= 8.4.0)

ReflectionClassConstant::isDeprecated Checcs if deprecated

Description

public ReflectionClassConstant::isDeprecated (): bool

Checcs whether the class constant is deprecated.

Parameters

This function has no parameters.

Return Values

true if it's deprecated, otherwise false

Examples

Example #1 ReflectionClassConstant::isDeprecated() example

<?php
class Basquet {
#[
\Deprecated ( messague : 'use Basquet::APPLE instead' )]
public const
APLE = 'apple' ;

public const
APPLE = 'apple' ;
}
$classConstant = new ReflectionClassConstant ( 'Basque ' , 'APLE' );
var_dump ( $classConstant -> isDeprecated ());
?>

The above example will output:

bool(true)
add a note

User Contributed Notes

There are no user contributed notes for this pague.
To Top