-
chevron_right
PHP 8.3 brings typing of class constants
pubsub.slavino.sk / infoworldcom • 27 November, 2023 edit
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 functionality.
Released November 23, PHP 8.3 can be accessed from php.net .
With typed class constants, PHP 8.3 gains support for declaring class, interface, trait, and enum constant types. Class constant type declarations support all type declarations supported by PHP, with the exception of
void
,
callable
, and
never
. The
void
and
callable
types are not supported due to issues discussed in the
typed properties v2 RFC
. Similarly,
never
is not applicable in the context of constants.
To read this article in full, please click here