Yeah, I implemented a simple ircd once. Funny days... but I don't know of any library/framework that could help you with the websocket protocol level, and I'm too old for writing my own ;)
But you could use something like websocketd, which spawns a process of your chioce for each client and pipes the websocket to stdin and vice versa.
https://github.com/joewalnes/websocketd
Each PHP process looks like it takes about 5 MB of ram on my laptop, so probably not the best method for 5000+ concurrent users if you use PHP, but still.
FYI - http://socketo.me/
[Maybe it was just a joke and I did not get it... or I did get it but did not identify it as a joke... however... I would like to see some beef...]
PHP is in any case a better choice, performance-wise, than Python or, god forbid, Java.
All just to make PHP a little faster. I think you are making my case.
Many websites don't ever get to 350M users, so it's safe to say that plain PHP will satisfy your startup for a long time. Also, PHP7 is pretty much on par with HHVM in real-world scenarios: https://kinsta.com/blog/the-definitive-php-7-final-version-h...
True, if you run it behind a web server like 99.999% of all users.
If you run it as a cli script, you can implement pretty much anything. I saw a ftp server once. Crazy.
Still, even on a normal web server, php can do long polling perfectly fine, which is often enough.
> being able to write program flows without dozens of promises is a breeze
It is a breeze with async/await too.