Instead of PHPDoc annotations, you can now use structured metadata with PHP's native syntax.
Less boilerplate code to define and initialize properties.
Instead of PHPDoc annotations for a combination of types, you can use native union type declarations that are validated at runtime.
The new match is similar to switch and has the following features:
Instead of null check conditions, you can now use a chain of calls with the new nullsafe operator. When the evaluation of one element in the chain fails, the execution of the entire chain aborts and the entire chain evaluates to null.
When comparing to a numeric string, PHP 8 uses a number comparison. Otherwise, it converts the number to a string and uses a string comparison.
Most of the internal functions now throw an Error exception if the validation of the parameters fails.
PHP 8 introduces two JIT compilation engines. Tracing JIT, the most promising of the two, shows about 3 times better performance on synthetic benchmarks and 1.5–2 times improvement on some specific long-running applications. Typical application performance is on par with PHP 7.4.