Event looped, asynchronous programming is possible with PHP! Streams, promises, async IO, web sockets -- you can do it all, with React PHP. Presented by Luke Kysow.
24. while (true) {
if (stream_select($read, $write, $exc, 1))
if ($read) {
foreach ($readable as $stream) {
// run callback for that stream
}
}
if ($write) {
foreach ($writable as $stream) {
// run callback for that stream
}}
}
}
32. High Performance Symfony
TL;DR: You'll get with this approach almost 2.000 requests/s instead of
130 on a large Symfony app.
Even if you have an "opcode cache" you have to
declare classes, instantiate your objects, read your
caches, etc for every single request. As you can surely
imagine this is very time consuming and far away
from being a perfect setup for high performance.
http://marcjschmidt.de/blog/2014/02/08/php-high-performance.html