Swoole 18,923 (https://github.com/swoole/swoole-src 18,923 ) is a C++ extension adding coroutines and HTTP, WebSocket and TCP servers. With SWOOLE_HOOK_ALL, blocking calls such as file_get_contents(), sleep() and PDO yield instead of blocking. Swoole 6.2.3 came out on 22 September 2026; the 6.2 line added PHP 8.5. Ubuntu 225 does not package it; pie install swoole/swoole (PIE replaces PECL) or a source build (18 seconds here) installs it:
<?php
Swoole\Runtime::enableCoroutine(SWOOLE_HOOK_ALL); // make ordinary blocking calls yield
Swoole\Coroutine\run(function () {
$t0 = hrtime(true);
foreach ([1, 2, 3] as $id) {
go(function () use ($id, $t0) { // go() starts a coroutine
$json = file_get_contents("http://127.0.0.1:8323/?id=$id"); // plain PHP, hooked
printf("%.2f s %s, Swoole %s\n", (hrtime(true) - $t0) / 1e9, $json, SWOOLE_VERSION);
});
}
});Output
0.50 s {"id":1}, Swoole 6.2.3
0.50 s {"id":3}, Swoole 6.2.3
0.50 s {"id":2}, Swoole 6.2.3OpenSwoole (https://github.com/openswoole/ext-openswoole 862 ), a 2021 fork, released 26.2.0 on 28 February 2026 with PHP 8.5 support. It has 862 GitHub 29 stars to Swoole's 18,919, so prefer Swoole for new work. Both are CLI-only.