PHP applications that need concurrency — calling several APIs at once, querying a database while reading a file — have historically relied on bolt-on libraries like AMPHP, ReactPHP or Swoole. The True Async project takes a different route: it implements a concurrency model inside the PHP engine itself, and its RFC is listed on php.watch with a target version of PHP 8.6.
The developer-facing API centers on a few concepts. spawn() creates a coroutine, a unit of execution that can be paused and resumed; await() waits for a coroutine's result; Scope manages the lifetime of a group of coroutines, including cancelling all of them if one fails; and cancellation is designed to be safe so data is never left half-finished. Wrapping three sequential one-second operations in spawn() and collecting them via await_all_or_fail() with a timeout lets them run concurrently, so total wait time approaches the slowest operation rather than the sum.
Unlike async/await in JavaScript or Python, True Async avoids "colored functions": there is no async keyword, and ordinary synchronous code runs inside a coroutine unchanged. The implementation achieves this by modifying the Zend core plus the I/O, database and socket layers directly. Under the hood it is cooperative multitasking — one PHP process, one thread — where the CPU switches to another coroutine whenever the current one blocks on I/O. An interactive visualization on the project site demonstrates this with two coroutines (one processing user data, one logging and sending notifications) sharing CPU time.
The project is more than a paper proposal. The current release, v0.8.4, is labeled "Experimental Core" and includes working coroutines, non-blocking I/O for functions like fread, file_get_contents and cURL, built-in PDO connection pooling, native thread support via spawn_thread() for CPU-parallel work, and even an HTTP/1.1, HTTP/2 and HTTP/3 server written in C running inside the PHP process without a reverse proxy. The extension installs on PHP 8.5+ via an official installer or a prebuilt Docker image; it is still experimental and not recommended for production.
More than 70 standard PHP functions have been adapted to become non-blocking automatically inside a coroutine while behaving exactly as before outside one — so no breaking changes for existing code. Covered areas include DNS (gethostbyname() and relatives), PDO MySQL and PgSQL, MySQLi, native PostgreSQL, cURL, sockets, file and stream I/O (fopen(), fread(), file_put_contents(), flock()), stream sockets, process execution (proc_open(), exec(), shell_exec()), timers (sleep(), usleep()) and output buffering with per-coroutine isolated buffers. flock(), a naturally blocking system call, is offloaded to a thread pool so other coroutines keep running. Still unsupported are directory operations like opendir() and mkdir() and some PDO drivers such as Oracle and SQLite, deemed lower priority because local metadata operations are usually fast enough.
The roadmap targets a stable v1.0 in November 2026, coinciding with the PHP 8.6 schedule: PHP 8.6 Alpha 1 shipped on July 2, 2026, Beta 1 is expected around mid-August 2026, and the final release is planned for November 19, 2026. Whether the feature actually lands in 8.6 remains open, as certainty for major core changes typically only arrives close to release.
For developers experimenting with the extension, a dev-only Composer package, true-async/ide-helper, provides autocompletion, inline documentation and stubs for PhpStorm, PHPStan and Psalm, covering the async core, the HTTP server and a ClickHouse client — useful given the API still changes between releases.
Comments
No comments yet — be the first.
Open the discussion
No account or password needed — just enter your e-mail and we’ll send you a one-time sign-in link. First time here? You’re set up automatically.
Your rating will be applied automatically after you sign in.
Check your inbox
We’ve sent a sign-in link to …. Open it on this device — this tab will sign you in automatically.
Waiting for your click …
·