PHP 8.3 Released With Typed Class Constants & Override Attribute

Written by Michael Larabel in Programming on 23 November 2023 at 12:39 PM EST. 12 Comments
PROGRAMMING
PHP 8.3 is out today as the latest major annual update to the PHP programming language.

PHP 8.3 implements a number of new language features and other improvements for this widely-used programming language. In my benchmarking of PHP 8.3 over the past few days I haven't noticed any major performance changes in either direction compared to PHP 8.2. Among the new features of PHP 8.3 are:

- Class constants can now be accessed dynamically with a new syntax addition.

- Implementing more appropriate date/time exceptions.

- Adding a json_validate() function for validating JSON.

- Implementing the #[\Override] attribute RFC to check that a method exists in a parent class or implemented interface.

- Updating the Zip extension and adding new set/get archive flag methods.

- The PHP POSIX support added posix_sysconf, posix_pathconf, posix_fpathconf, and posix_eaccess functions.

- A number of new PHP Sockets options.

- New features for the Randomizer class.

- Adding support for newer cURL options and constants up through cURL 7.87.

- Various new DOM methods added for DOM nodes and elements.

- Support for rounding negative places within the number_format() function.

- Support for zend_call_stack_get on OpenBSD platforms.

- Support for linting multiple files at once using the php -l option.

- Support for negative indices in arrays.

- Support for anonymous read-only classes.

- Support for typed class constants with class, interface, trait, and enum constants now supporting type declarations.

- Closures created from magic methods can now accept named arguments.

- The PHP CLI now supports linting multiple files.

- Implementing the STREAM_NOTIFY_COMPLETED notification for PHP streams.

- Many bug fixes and other improvements.

PHP logo


Downloads and more details on today's PHP 8.3 release via PHP.net.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week