PHP's Polling API: The Missing Piece for Fiber-Based Async
PHP's Polling API RFC has merged to master. See how it pairs with Fibers to finally give async PHP a native event-readiness primitive.
PHP's Polling API RFC passed 33-1 and has already merged into master, with alpha slated for July 2, beta for mid-August, and GA targeted for November 19. That timeline matters because it finally gives Fibers, in core since PHP 8.1, a native, efficient way to know when to resume.
The key distinction: a Fiber is a concurrency primitive, not an event loop. Fibers let functions pause and resume; the Polling API is the missing native mechanism for asking the OS which file descriptors are ready, without maintaining separate backend implementations. That gap is exactly why ReactPHP ships four different loop implementations and why AMPHP built Revolt from scratch.
A minimal working scheduler makes the concept concrete: a single Io\Poll\Context drives multiple Fibers, each fetching a URL over a raw non-blocking socket, with no tight-loop polling anywhere. The example also surfaces production-relevant details often glossed over, like handling short writes on non-blocking streams and correctly detecting EOF without extra branching.
For engineers, the practical payoff is clearer visibility into what libraries like Amp v3/Revolt and ReactPHP are doing internally, now that the underlying primitive they've each had to reinvent is finally native to PHP itself.