Constant %s::%s is deprecated

Description

This error is emitted when a class constant is supported in the current PHP engine, but will be removed in a future version.

The error is emitted every time the class constant is used: it may be for its actual intend, or anywhere else.

The error message is also emitted with the usage of the Deprecated attribute, since PHP 8.4.

Example

<?php

class X {
     #[Deprecated()]
     public const D = deprecated;
}

echo X::D;

?>

Literal Examples

  • Constant X::D is deprecated

Solutions

  • Stop using that class constant.

  • Find the replacement for this class constant: it might be another constant, or a different command entirely.