New Features of PHP 8.3


PHP 8.3 is set to be released on November 23, 2023. The following are the innovations and changes that PHP 8.3 will bring - each with links to further information.

Typed Class Constants

Now you can define a data type for a class constant with typed class constants. This makes your code more secure and cleaner.

The json_validate Function

The json_validate function is a novelty that allows validating a JSON string and receiving helpful and accurate error messages in the process.

Dynamic Class Constants and Enum Member Fetching

The support for dynamic class constants and enum member fetching gives you more flexibility and dynamism in programming.

Additional GC Information from gc_status()

The gc_status() function now provides additional information about the garbage collection. A useful tool to optimize your memory usage.

New Methods in the Random Extension

The Random extension receives two new methods: \Random\Randomizer::getBytesFromString for generating bytes from a string and \Random\Randomizer::getFloat() as well as nextFloat() to generate random floating-point numbers.

Fallback Values for PHP INI Environment Variable Syntax

There is now fallback value support for PHP INI environment variable syntax to define a substitute value if the environment variable is not set.

PHP CLI Lint Checks Multiple Files at Once

The php -l command now allows checking multiple files at once, which accelerates your workflow.

Alias for Built-in PHP Classes with class_alias()

The class_alias() function now supports aliases for built-in PHP classes. This allows you to interact better with these classes.