Every two weeks I send out a newsletter containing lots of interesting stuff for the modern PHP developer. You can expect quick tips, links to interesting tutorials, opinions and packages. Want to learn the cool stuff? Then sign up now!

Symfony and Laravel will require PHP 7 soon

According to Fabien Potencier, lead of the Symfony project, the next major version of Symfony, to be released at then end of 2017, will require PHP 7.

But Laravel will drop PHP 5 support even sooner. Taylor Otwell, the creator of Laravel, announced that Laravel 5.5, to be released in June 2017, will leave PHP 5 behind.

On multiple occasions Taylor et co. have stated that they don’t like the strictness that things like scalar and return type hints bring to the table. So I don’t expect to see them appear much in Laravel codebase. Smaller syntax improvements like for example the null coalescing operator will almost certainly be used.

A few weeks ago Jordi Boggiano reported that only a miserable 3% of all packages present on Packagist require PHP 7. The best thing about Symfony and Laravel dropping PHP 5 support is that it will send a strong message throughout the entire PHP ecosystem that you shouldn’t bother with PHP 5 code anymore. When creating new projects and packages more developers will target PHP 7 as a minimum version as well.

For our PHP and Laravel packages we left PHP 5 behind as soon as PHP 7 was available. Our packages already make extensive use of return type hints, anonymous classes and the null coalescing operator to create more readable (and thus more maintainable) code.

(Fun Scary fact: WordPress only requires PHP 5.2 😱)

Freek Van der Herten is a partner and developer at Spatie, an Antwerp based company that specializes in creating web apps with Laravel. After hours he writes about modern PHP and Laravel on this blog. When not coding he’s probably rehearsing with his kraut rock band. He loves waffles and butterflies.
  • zakius

    it’s great that we have something called semver
    and so sad noone cares