I don't know what changes this proposal could bring to PHP if the aim is simply to introduce event loop mechanisms like epoll or kqueue. Why not make ext-uv (libuv) or ext-event (libev) built-in PHP extensions, just like ext-curl, ext-xml, or ext-bcmath? These event loop libraries have been thoroughly tested across numerous projects, proving to be extremely stable and reliable. They could serve as the foundational infrastructure for implementing asynchronous IO in PHP.
----- Tianfeng.Han ------------------ Original ------------------ From: "Larry Garfield"; Date: 2025年11月2日(星期天) 凌晨3:24 To: "php internals"; Subject: Re: [PHP-DEV] [RFC] Polling API On Thu, Oct 30, 2025, at 4:06 PM, Jakub Zelenka wrote: > Hello, > > I would like to introduce a new polling API RFC that is part of my > stream evolution work: > > https://wiki.php.net/rfc/poll_api > > Kind regards, > > Jakub I freely admit to not being fully versed in this area, so take my feedback with however much sodium chloride you feel is appropriate. - Given that a lot of people reading this are probably no more versed in kernel IO polling than I am, a section early on explaining the context of what is even being discussed would be most appreciated. - I really would rather not add more global constants. Better to at minimum make them class constants of a class that the new API provides. (Maybe PollHandle?) - Conversely, I'm unclear why the PollBackend is an enum. That implies the list of backend implementations is fixed and immutable, and not extensible now or in the future. I find that claim suspect, as there are six already. (I find that following the 0-1-many rule in most cases pays off in the long run.) - PollWatcher is created only by PollContext. OK, then please list PollContext first so that reading PollWatcher I have the, er, context for where it fits. - Speaking of, when there's very long code blocks like this I much prefer to break it up to a block per class, so as to minimize codeblock scrolling. That makes it much easier to read and jump around as I figure out how it all works. - How would requesting a specific poll backend be helpful, if it varies by OS? If I'm running on Windows, asking for the Linux backend wouldn't help me much, or vice versa. I don't see the use case here. (Ie, please describe the use case in more detail.) - Who is the target audience for this? I'm pretty sure it's not anything I normally work on, so it's hard for me to judge if certain decisions are good, bad, or "sucky but we have to." Eg, getData() returning "who the hell knows" strikes me as a footgun in waiting, but I don't have enough context to know if that's an inherited problem from elsewhere. Overall, I think my biggest feedback is "please explain better why any of this matters, because I assume it does somehow but don't understand how from the RFC." --Larry Garfield
