ReflectionClassConstant::isDeprecated

(PHP 8 >= 8.4.0)

ReflectionClassConstant::isDeprecatedChecks if deprecated

Açıklama

public function ReflectionClassConstant::isDeprecated(): bool

Checks whether the class constant is deprecated.

Bağımsız Değişkenler

Bu işlevin bağımsız değişkeni yoktur.

Dönen Değerler

true if it's deprecated, otherwise false

Örnekler

Örnek 1 ReflectionClassConstant::isDeprecated() example

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

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

Yukarıdaki örneğin çıktısı:

bool(true)

Ayrıca Bakınız

add a note

User Contributed Notes

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