HomeMenu
Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

isDeprecated

Description

The isDeprecated of ReflectionConstant for PHP checks if the constant is deprecated.

Syntax

public ReflectionConstant::isDeprecated(): bool

Return

Returns true if the constant is deprecated, false otherwise.

Examples

1 · false

<?

namespace Mynamespace
{
    const MYCONSTANT = 'value';

    $reflectionconstant = new \ReflectionConstant('Mynamespace\MYCONSTANT');

    $return = $reflectionconstant->isDeprecated();

    var_export($return);
}
false

2 · true

<?

$reflectionconstant = new \ReflectionConstant('E_STRICT');

$return = $reflectionconstant->isDeprecated();

var_export($return);
true