The method assumes that the first non-empty token before the constant name must be T_CONST for a constant to be a class constant, but this is not the case for typed class constants. The example above ...
that's specific to the class in question. For example, for the 'Car' class you could define class constants to represent various types of cars, then use these constants when creating 'Car' objects: */ ...
PHP 8.3, a major update to the popular server-side web scripting language, offers features such as explicit typing of class constants, deep cloning of readonly properties, and additions to randomness ...