8 game changers in PHP 8 with code examples
Do you think that JIT in PHP 8 is the most awaited feature? Take a look at other, in my opinion PHP 8 game changers. I can’t wait for 26 November for stable release of major version 😍
Stringable Interface
Just-in-time compiler
Of course, loved by many, JIT. One of core PHP developers — Zeev, showed a demo with generating fractal to compare PHP 7.0 performance with JIT.
String functions
Several hint types
Union types allows for type hinting several types, and… usefull for vendors, new type mixed
that represents several types at once.
Trailing commas in parameter lists
Attributes
Currently for “attributes”, we just use Doctrine Annotations. A native solution will be revealed in a moment.
Throwing exception in expressions
Non-capturing catches
Don’t you need exception variable? Just do not specify variable for exception.
And you? What is for you the best feature of PHP 8? Write comment 👇