Hacker News new | ask | show | jobs
by outime 2131 days ago
Maybe I'm not in the right circles but I see absolutely no renewed interest towards PHP. Is there any reason to believe that? Honest question - PHP was my first language (or second if you want to consider mIRC scripting) and I have not so bad memories but at least me and everybody I know moved away from it years ago and don't see people going back to it anytime soon.
3 comments

There's been one big change in the last 5 years – the adoption of type-inferring PHP static analysis tools in CI.

As companies started adopting TypeScript/Flow into their Javascript pipeline, PHP developers realised the need for something similar in their ecosystem.

I work at Vimeo (which has a lot of business logic in PHP) and I took it upon myself to write a static analysis tool (which you can play with at https://psalm.dev). Other similar static analysis tools were developed at other places that use PHP, and together they have helped make modern-day PHP development a little more orderly.

Thats pretty rad.

I'm curious if you guys use PHP at all for any real time workloads. Thats where I've always had struggles with PHP.

Also, have you found the event dispatch system of the modern PHP frameworks to be slower over time?

I've used PHP in a realtime setting as part of Psalm's Language Server, but it's clearly not built for such workloads – the lack of native async support gets in the way.

If most of the stuff you're doing requires an event loop I'd consider other options before PHP, but if it's mainly serving web requests PHP is my go-to.

Your example is similar to a WordPress developer saying they adopted modern PHP - sure, they were on PHP already. But at least Vimeo still wanted to stick to PHP so that's one positive point.
Symfony was the backend framework with the most contributors in 2019[1], and Laravel is seeing some huge growth in the PHP community. I think there's a lot of hype for the modern improvements in the language, and it's quite easy to manage a stateless web server in production making it a safe technology to use.

[1]: https://symfony.com/blog/symfony-was-the-backend-framework-w...

Doesn't make it the best backend framework of 2019!

In all seriousness, I think this has more to do with the ease of PHP development comparatively to other stacks. Even Python (arguably just as easy to learn as PHP), has more overhead here.

For context for talking off the cuff, I’m not certain that this equates to a raw quality, having used Symfony professionally for a few years I found there where a lot of limitations, particularly around the dependency injection and event dispatch system, that required a lot of work to keep performant because of the inherited limitations of PHP as well as what I feel were not the best design decisions around this idea, but I’m glad so many others have had great success here
I mean surely that depends on the crowed you hang around with. Majority of people I interact with use PHP primarily. Anecdotal evidence isn't great at identifying trends.