(PHP 8 >= 8.4.0)
ReflectionClassConstant::isDeprecated — Checks if deprecated
Checks whether the class constant is deprecated.
This function has no parameters.
Example #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());
?>
The above example will output:
bool(true)
Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!
Check out: eBank.nz (Art Generator) |
Netwrck.com (AI Tools) |
Text-Generator.io (AI API) |
BitBank.nz (Crypto AI) |
ReadingTime (Kids Reading) |
RewordGame |
BigMultiplayerChess |
WebFiddle |
How.nz |
Helix AI Assistant