Skip to content

Comment on Choosing PHP in 2022 and beyondparent

Comments

any form of concurrency can't easily be [achieved] with PHP

This was true 10 years ago. Not so today - the tools are there, and the frameworks are making it simple to deploy them.

https://twitter.com/aschmelyun/status/1548270721964462081

https://laravel.com/docs/9.x/octane

https://openswoole.com/article/symfony-swoole

But more importantly: the vast majority of apps don't need this. PHP by itself is fast enough for most use cases when set up properly.

From my understanding of how php works it should be "concurrent" by default - each request is handled by web server and then php interpreter is running code in concurrent manner.

There is some shared context that is session for example but how I understand it each request is concurrent anyway.

Is there support for running single script continously?

Your first point assumes that you always run a web application. PHP can be used for general purpose scripting as well. Also even on a Web context how would you support websockets with traditional php? You can how achieve that with swoole.

That's one way to look at it, but there is much better support now for writing code that behaves concurrently within a single web request.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.