8 game changers in PHP 8 with code examples

Filip Nowacki
1 min readJun 14, 2020

--

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

Link to RFC

Just-in-time compiler

Link to RFC

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

Link to RFC

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 👇

--

--

Filip Nowacki
Filip Nowacki

Written by Filip Nowacki

Engineering Manager // Co-Founder of Renthelp // Long term investor // I make complex ideas simple and fun to learn.

No responses yet