Datadog collects and monitors your PHP app metrics and distributed traces in real-time with application performance monitoring. Decrease downtime and performance issues with Datadog APM by tracing requests across service boundaries and drilling into individual traces end-to-end with flame graphs. Start your 14-day trial for free today.

Why we are requiring PHP 7 for our new packages

Link –

The past few weeks we released several new packages: laravel-sluggable, laravel-robots-middleware, laravel-glide and pdf-to-text. These packages have in common that they all require PHP 7. Because there were several reactions and questions about this, I'd like to shed some light on that decision.

I expect that lots of developers will make the move to PHP 7 in the coming year. Sure there will always be legacy projects that'll never see an upgrade, but it makes no sense starting a greenfield project in PHP 5.X. The performance benefits are just too good. On the package side I expect that some widely used packages will make the jump as well. Jordi Boggiano has already announced that the next version of Monolog targets PHP 7. Also keep in mind that active support for PHP 5.x is coming to end this August (or at the latest December).

Not only developers will make a quick move to PHP 7. The speed benefit is quite interesting for hosting companies as well. A speedier PHP version means a machine can host more sites. There quite a few hosting companies that already made the jump and are offering PHP 7 support.

When we work on projects at Spatie we have to solve a lot of problems. When we solve a problem in way that the solution can be used in future projects, we create a package. So we create these packages primarily for our own future projects. We decided that from now on every greenfield project wil be a PHP 7 one. So it makes sense that our new packages would require PHP 7 as well. By doing so we can make use of the latest new features such as the scalar type hints, return types, anonymous classes and the null coalescing operator. At some point all our projects will leave PHP 5.6 behind. The earlier we won't have to deal with PHP 5.X code anymore the better.

I'm well aware that requiring PHP 7 will hurt the popularity of our packages in the short run. But popularity is not our main goal. People who are using the latest and greatest version of PHP can benefit from our work. And I hope others will be nudged a bit towards PHP 7 by our decision.

(EDIT: we won't change the requirements of our older packages. PHP 7 will only be required when we create a new major version.)

Stay up to date with all things Laravel, PHP, and JavaScript.

Follow me on Twitter. I regularly tweet out programming tips, and what I myself have learned in ongoing projects.

Every two weeks I send out a newsletter containing lots of interesting stuff for the modern PHP developer.

Expect quick tips & tricks, interesting tutorials, opinions and packages. Because I work with Laravel every day there is an emphasis on that framework.

Rest assured that I will only use your email address to send you the newsletter and will not use it for any other purposes.

Comments

Webmentions

Evert Arnould liked on 18th March 2020
Jarrod Tomholt liked on 18th March 2020
Wesley van Klaveren liked on 18th March 2020
Spatie retweeted on 18th March 2020
Raul liked on 18th March 2020
Erfan Hemmati liked on 18th March 2020
Ash Redman liked on 18th March 2020
Luka Peharda liked on 18th March 2020
Fortez Fabrice liked on 18th March 2020
Fred Carlsen liked on 18th March 2020
David H. Sianturi liked on 18th March 2020
Lars liked on 18th March 2020
Andrew Schmelyun liked on 18th March 2020
Krishan 🤖 liked on 18th March 2020
loreias liked on 18th March 2020
Beny Hirmansyah liked on 18th March 2020
rgj liked on 18th March 2020
Craig Potter replied on 18th March 2020
@freekmurze you do you. Everyone else should just enjoy and be thankful for all you and @spatie_be share. I tip my hat to you good sir!
Logan Henson retweeted on 18th March 2020
hedeqiang retweeted on 18th March 2020
hedeqiang liked on 18th March 2020
Arash liked on 18th March 2020
Chris liked on 18th March 2020
Antoine liked on 18th March 2020
Hardik Shah liked on 18th March 2020
Michael Dyrynda liked on 18th March 2020
DimZ liked on 18th March 2020
Peter Brinck 🤘 liked on 18th March 2020
Rod Elias liked on 18th March 2020
Logan Henson liked on 18th March 2020
Tyler Woonton liked on 18th March 2020
BongoBongo replied on 18th March 2020
A guy do something for free. Suddenly he gets tons of obligations to third screaming parties. Today open source world.
Freek Van der Herten replied on 17th March 2020
Those are your rules, not mine. For me, it makes zero sense investing time to keep things compatible with version of the framework/PHP that I don’t use.
Roberto B 🚀 liked on 17th March 2020
byron fichardt liked on 17th March 2020
Torbjørn Nerbøvik liked on 17th March 2020
Marijan Barkic liked on 17th March 2020
Salman Zafar liked on 17th March 2020
Johann Rudolf liked on 17th March 2020
Geoffrey van Wyk liked on 17th March 2020
hans 👀 liked on 17th March 2020
Kenny Horna liked on 17th March 2020
Lucas Michot liked on 17th March 2020
Antonio Pauletich replied on 17th March 2020
Those are not my "rules" nor I imply that you should follow them as I'm a package maintainer myself. Those are just observations (especially about the general treatment of the LTS when comparing the Laravel and Symfony ecosystem).
Antonio Pauletich replied on 17th March 2020
Let me state this again. I'm not asking anybody to spend time on something that doesn't benefit them. I'm just comparing the situation in two of the biggest PHP ecosystems and how each treats its LTS releases.
Daniël Klabbers replied on 17th March 2020
I think no one should be this entitled to demand anyone else to spend time on something that doesn't benefit them. In addition anyone in need of patching a (tagged) version in a package can contribute the fix. No branch is needed for that.
Antonio Pauletich replied on 17th March 2020
I don't know the context of this twit, but there should always be an actively maintained branch that supports the latest LTS, otherwise it makes the LTS kinda pointless. In the SF ecosystem I haven't yet seen a package written from scratch that doesn't support the latest LTS.
Guus replied on 17th March 2020
Most of spatie's packages do have an MIT license so for those who want to support an older PHP version. Just fork it and make it compatible yourself.
Raphael Cunha liked on 17th March 2020
Ahmad El-Bardan liked on 17th March 2020
Jamie Peters liked on 17th March 2020
Iruku Kagika liked on 17th March 2020
Dinh Quoc Han 🐳 liked on 17th March 2020
Danijel K. liked on 17th March 2020
Chase Miller liked on 17th March 2020
Francisco Neves liked on 17th March 2020
Chris Hardinge liked on 17th March 2020
misterflo liked on 17th March 2020
Grant Williams liked on 17th March 2020
Andrei Scripcaru liked on 17th March 2020
Cristian Giordano liked on 17th March 2020
Andrés Herrera García liked on 17th March 2020
Scott Zirkel liked on 17th March 2020
theonlyub liked on 17th March 2020
ダビッド トレス retweeted on 17th March 2020
Povilas Korop liked on 17th March 2020
De Belser Arne liked on 17th March 2020
José Cage liked on 17th March 2020
Sergiu liked on 17th March 2020
Peter Fox liked on 17th March 2020
Lucas liked on 17th March 2020
Andrés Santibáñez liked on 17th March 2020
Miguel Piedrafita 🚀 liked on 17th March 2020
Bas de Groot liked on 17th March 2020
talv liked on 17th March 2020
Lee Overy liked on 17th March 2020
Rémi Pelhate liked on 17th March 2020
Wyatt liked on 17th March 2020
Jeff Kilroy liked on 17th March 2020
Owen Voke (pxgamer) liked on 17th March 2020
Jorick de Lange liked on 17th March 2020
Frank Sepulveda liked on 17th March 2020
Marisa Clardy liked on 17th March 2020
Sam Snelling liked on 17th March 2020
Jake Casto liked on 17th March 2020
Chris White liked on 17th March 2020
ダビッド トレス liked on 17th March 2020
João Magalhães liked on 17th March 2020
AWS Support replied on 17th March 2020
Hi, Nuno. We'd love to hear how we can better your experience. You can share more detailed feedback through the Management Console by clicking on the 'Feedback' button in the bottom left-hand corner. 👍 ^CM
Alan Wynn ツ replied on 17th March 2020
I remember being one of those people when I first started. When you changed a PHP version requirement. Looking back, I was a dick, and you forced me to up my game. So I appreciate the stance you have. Did you ever get my postcard?
talv replied on 17th March 2020
Tbh i like it since it forces people to stay with the times and invest those couple of hours in project upgrades!
Nuno Souto replied on 17th March 2020
The only thing I don’t like is that @AWSSupport only supports MySQL 5.6 compatibility with their Serverless offering so I always have to remove or adapt any json fields and make sure queries work :(… unless I get a “serverless” server.
Marisa Clardy replied on 17th March 2020
Only issue is that currently, we cannot switch to php 7.4 since ionencode Currently doesn't support it. But hopefully soon. 🤞
Azraar Azward retweeted on 17th March 2020
Anton liked on 17th March 2020
Reza liked on 17th March 2020
Florian Voutzinos ⚡ liked on 17th March 2020
Joiner Leal liked on 17th March 2020
Joseph Leedy 🇺🇸 liked on 17th March 2020
oluwajubelo loves VueJS 🚨 liked on 17th March 2020
Günther Debrauwer liked on 17th March 2020
Anne Koep liked on 17th March 2020
Peter Sowah liked on 17th March 2020
Cyril de Wit liked on 17th March 2020
Azraar Azward liked on 17th March 2020
Loris Leiva liked on 17th March 2020
Leonel Elimpe liked on 17th March 2020
Trevor Greenleaf liked on 17th March 2020
Ian Hawes liked on 17th March 2020
Felipe Dalcin liked on 17th March 2020