
PHP 8.4 released with property hooks, asymmetric visibility, an updated DOM API, and more
PHP 8.4 has been released, introducing a range of new features and improvements to the widely-used programming language. Key updates include property hooks, which support computed properties natively understood by IDEs and static analysis tools, enhancing pre- or post-processing of values. Asymmetric visibility now allows separate control over reading and writing permissions for properties, reducing the need for boilerplate getters.
The release also introduces the #[\Deprecated]
attribute, extending PHP's deprecation mechanism to user-defined functions, methods, and class constants. The updated DOM API offers standards-compliant support for HTML5 parsing and resolves several compliance issues. BCMath now supports object-oriented style and operator overloading for arbitrary precision float numbers.
New array functions array_find()
, array_find_key()
, array_any()
, and array_all()
have been added, alongside new PDO subclasses for various databases, including Pdo\Dblib
, Pdo\Firebird
, Pdo\MySql
, Pdo\Odbc
, and Pdo\Sqlite
. Additionally, properties and methods of new objects can be accessed without wrapping the new
expression in parentheses, streamlining code syntax. The update also includes performance enhancements, bug fixes, and general cleanup.