PHP in 2020
PHP 8.0.0 Beta 3 is available for testing
Currently PHP 8.0.0 is available for testing, Since it’s a major version release, you can expect few backward breaking changes.
Along with breaking changes it also introduced many new features and fixes.
For a complete list of fixes and features check this link.
Major backward incompatible changes which may impact you
- match is now a reserved keyword. It means now you can’t create methods, classes, traits etc with this name.
- Methods with the same name as the class are no longer interpreted as constructors. The __construct() method should be used instead.
- Removed ability to specify an autoloader using an __autoload() function. spl_autoload_register() should be used instead.
- The @ operator will no longer silence fatal errors.
After the introduction of type hinting in PHP 7.0, community has introduced Union types which may bring more control over argument data types.
This feature will promise significant performance improvements.
As null coalescing operator introduced in PHP 7.0, similarly nullsafe operator has been introduced which will work on method call.
The new PhpToken class adds an object-based interface to the tokenizer. It provides a more uniform and ergonomic representation, while being more memory efficient and faster.
- Declaring a required parameter after an optional one is deprecated.
- ReflectionFunction::isDisabled() is deprecated.
- libxml_disable_entity_loader() has been deprecated.
- The JSON extension cannot be disabled anymore and is always an integral part of any PHP build, similar to the date extension
- The minimum required libxml version is now 2.9.0.