Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129365 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id CB0F41A00BC for ; Fri, 21 Nov 2025 13:13:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1763730786; bh=uKJSWaS9bL35k76SoNfFIlF6PLtFZptTUXcuMwdisjY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=CxCFVQgZg4/OrU6lKDvk55MFwOB+SvkCJjEvq2rO3ThXvWctUgNZK16nuDLR5Wzt0 Yp/TSORIxWmzxMR2JIF/9tg7B59W4Vll29pqWwz5NzOkPBt5edzp7DXUxP1kHO9yLA rIW1ewdA775Iy+vq601C2dGbB4Ft34rzILXecxzAmX5G+R1xMBLI17fyKzZ9HpxpRL 0C50dZlt2YIW9QF6kGyjOYxw2mcnlAsJxnj+X11PXf5wZyK1zn8ttnTOMShFo0Q3y6 z/WlluZltGqxsakSnRcGDa0cCwbMtWgToQurpyH7B3D/xcX48ofDmzxA6j7x78fK0T xKhTYMKTM75qQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 21AC31804D9 for ; Fri, 21 Nov 2025 13:13:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-qt1-f170.google.com (mail-qt1-f170.google.com [209.85.160.170]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 21 Nov 2025 13:13:04 +0000 (UTC) Received: by mail-qt1-f170.google.com with SMTP id d75a77b69052e-4ee13268accso1288341cf.3 for ; Fri, 21 Nov 2025 05:12:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763730779; x=1764335579; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=uKJSWaS9bL35k76SoNfFIlF6PLtFZptTUXcuMwdisjY=; b=NgW83y+9sRlfTqOXkcsxS5rhZIWDcK52OMr9D10Mo1x9q1wzC2NcE7ky1kD/NnOORC N6YhzBi5TRrKKqOisD/PbO5Tk0IPYhfyqiukiqiR3+nQGR1hP/bgJ4NoYTg6s618P8CR 1rtxJ6D7M4Dkd97HiuUtL4x5yudlDlzrNgRejmM0FFtOeLg4nbtNhKoV8rbUOdhbWXXg rUjA+lwBHe5d1iIkV5vgrytdJPolwvpCp8Sn0cdzDy1uqec9Chdp1wyTNQMV2Y2+iiQj x6O7gJkG1hTFpXnLm42ymAEOcyw/DCPbatQFo5PdicHpKYUM2PuqdVkuoATa5OknV9Ey YNlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763730779; x=1764335579; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=uKJSWaS9bL35k76SoNfFIlF6PLtFZptTUXcuMwdisjY=; b=j6XmWD0i9uRWQtylolNONObrQjA/KUcK51UsfF/SDpjPBqrOUbCB+TtzK3soTAB9nk QKLrIN6opgobc9JwqSgN7Eqrl055AkoZgW6aLMJUaj9BjuxB9da6JdvhC58FHiV0lEYP s0O4Ydu33Qd7l+zXOtSid3BJg8dZSaVaAsg+fg/54SC/3sKHNszZ6UFtq9NoJAOE5X+C oB+HdDWQSrZbEVY9C7GDsIBqnJafot7omaUOfJ1WdrMKvY7mYJUer7ypHdSY/28pFRlI GCZn5kpKzlEMq0nDuqdhWQumxm3AO5rZNc99zm5JzcUjE6nh9zrTSpblJkM+XTwjMk37 Bi7g== X-Forwarded-Encrypted: i=1; AJvYcCWRPir2GlGnPjMC2VydyQqApNgI7+liT0R1ELVbzqXeJncw2rdCgWNEd+Ko2FBIk85c46jt5dy8NyM=@lists.php.net X-Gm-Message-State: AOJu0YzAGSy1swiTDkgCpBjcqiNv/Hbx9rKRf/Eop9uh/w+J/tCuPcoT MTURIx8bnapxuz0tGJ8ZOP6lL4ns2Gz1dm5OL/fLlSurroEQIQNRUetNO8R+6h3eJlcssjCvQAp IhEpQGchf4dsnGvErngDcbjNKSEDHUeYDsRdS X-Gm-Gg: ASbGncsJ0bcTbKOpuWa7g2B8Vw1h5Qa2YYMlYpzyPocDCW/52CxqzNXqIuYo7whXf6z i2ChZubphtG5OIfh/+AwdyAWV0i0F4KbBtiM0KqOK/n42o/7ou8NjFBMSg69VVScH39pEtYNyi9 9ddzGfoUso2pvluVuYYaOSbFHWGqGJBhC+v8non72GxGI2eZLqQDeGrp+MTWY290BIKy+4Vzl1q /23YwxZrSxzrf1NXLqrMWXiDqw9rwGopD9RVCrbsLlw3VcF81Xp6GXVIPQJtns0CdM03XeOkh+O 0OawiGkjw9C5RxkYs4xDTXaRckU= X-Google-Smtp-Source: AGHT+IHnD4GyCaF2MiP6wWcLf/b8kqNd3wKyzjrvpNky0nP3wZZfMY+1iC5lA7zEgMV6iO4A7dlNrQapgF7iwoTe0h8= X-Received: by 2002:a05:690c:6611:b0:786:70d6:96b0 with SMTP id 00721157ae682-78a8b55cb4emr13880057b3.7.1763730427219; Fri, 21 Nov 2025 05:07:07 -0800 (PST) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 21 Nov 2025 10:06:30 -0300 X-Gm-Features: AWmQ_bliSQdZtUl2l-lu3L-xgNmYBPYYcXnnM2mXNCOD-UppuTSRbu-T3FWL_z4 Message-ID: Subject: Re: [PHP-DEV] [VOTE] True Async RFC 1.6 To: Edmond Dantes Cc: Jakub Zelenka , "Rowan Tommins [IMSoP]" , internals@lists.php.net Content-Type: multipart/alternative; boundary="00000000000098151d06441a7db1" From: deleugyn@gmail.com (Deleu) --00000000000098151d06441a7db1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 21 Nov 2025 at 09:08 Edmond Dantes wrote: > Hello > > > I think you seriously underestimate impact of this in the current PHP > code bases where many applications depend on global state. > Do I really look like someone who could underestimate memory-related > issues? :) > > > Now imagine that some popular plugin decides to use async which change > some of its globals (like $post or $wp_query) during the suspension of th= e > main code. I would assume this could horribly break things. > Or for example, you run an old WordPress on the new PHP 8.5 and > everything breaks. Is that a reason not to release new PHP versions? > No, I=E2=80=99m not joking. That=E2=80=99s literally the essence of the a= rgument. If > something might break, then we shouldn=E2=80=99t do it? > > This is a common story. There is a framework that is adapted to a > technology, and there is a framework or library that is not adapted to > it. > If a framework is not adapted, you simply won=E2=80=99t be able to use th= e > technology. So why is this considered a problem? > However, inside WordPress you will still be able to use coroutines as > long as you don=E2=80=99t call WP functions that aren=E2=80=99t adapted. = You can. So > why is this a problem? > > I can use AMPHP inside WordPress and break WP. > So does that mean we must urgently remove Fiber from the language? > Because AMPHP uses Fiber, and AMPHP implements coroutines. And > coroutines break WordPress. > Asynchrony already exists in PHP. You can write async code today. > Which means you can already do all the =E2=80=9Chorrors=E2=80=9D you=E2= =80=99re talking about. > TrueAsync cannot change that. And no one else can change it either. > So why is this being treated as an argument against it? > > > Don't forget that other code don't have control over the plugin and it > might not even know that async is used there. > Exactly. This means that right now I can use Fiber plus select() to > write async code and break WordPress. > And I can also write a plugin that divides by zero and crashes > WordPress, and WordPress won=E2=80=99t know anything about it. > > > So I'm not sure if this design is compatible with WordPress > > Yes, WordPress is not compatible with asynchrony. I=E2=80=99ll emphasize > again. This is not about TrueAsync specifically. This is about > asynchrony itself. Yes, WordPress and Laravel are not compatible with > concurrent execution. That=E2=80=99s true. > But are you **really suggesting** that because of this, all other > applications should be denied the ability to use it? > Moreover, would you deny WordPress itself the possibility of > supporting asynchrony in future? After all, WordPress can be > refactored. It=E2=80=99s not carved in stone. > > Wouldn=E2=80=99t WordPress benefit from the performance improvements that > async provides? > Wouldn=E2=80=99t WordPress plugins benefit from being able to actively > communicate with microservices and deliver the fastest possible > responses to JavaScript? > > Is this feature really something nobody needs? If yes, then I have no > further questions. > > Async is needed to increase throughput. That=E2=80=99s the purpose. If a = PHP > project doesn=E2=80=99t need it, it doesn=E2=80=99t have to use it. That= =E2=80=99s fine. But > there are PHP projects that do need it. The point you=E2=80=99re trying to make here is very clouded for me. Althou= gh you can use AMPHP to break Wordpress, there is an extensive process of =E2=80= =9Copt-in=E2=80=9D for you to do that and it doesn=E2=80=99t happen naturally, accidentally or unintentionally. You=E2=80=99ll have to setup a plugin that requires AMPHP = and write some code that will inadvertently break and never really see the light of day. Now there=E2=80=99s 2 possibilities for us to go from here: my understandin= g of the most basic concept of TrueAsync is still wrong OR the comparison you=E2=80= =99re trying to make isn=E2=80=99t relevant. My understanding is that if this RFC were to be implemented as-is, you would be able to open any PHP file and write \Async\spawn() and: nothing would blow up but any code inside the project that touches global state could silently misbehave. Is this not true? My understanding of AMPHP is that things only become async if you explicitly run AMPHP as your web server. It either has no effect if your application is running Apache + mod_php OR your application 100% breaks with nothing getting executed at all. Is this not true? I know you're tired of debating very basic things, but from the conversation on the list, I think I'm not the only one confused by this. We did talk about our desire to have Async on PHP-FPM and as far as I remember you mentioned it not being very useful, but that it would be possible nonetheless. This is the a core principle that matters a lot. Here is a very simple hypothetical: Suppose I run a website and I have very little understanding of PHP, but I know the basics. Every Monday I run `composer update`, do a little testing and deploy the website. Suppose next Monday when I run `composer update` one of my dependencies (Package A) starts to pull in AMPHP as its nested dependency. When I try to open my website locally it will either have everything broken or it will just work regularly and nothing will be running async. There is no other option. Now suppose the same example but with PHP 9 + TrueAsync. I do `composer update` one day and test my home page and it works. But deeply nested somewhere there is a feature that will use Package A which then spawns a coroutine and leads to my global state code behaving weirdly. It's not a fatal error. It's not very clear at all to me that something changed, but now my array indexes are triggering DB updates out of order. If my assumptions about TrueAsync are completely wrong and that's not possible at all, I think that's not clear for everyone. But if my assumptions are right, then your comparison with AMPHP is not the same thing. --00000000000098151d06441a7db1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Fri, 21 Nov 2025 at 09:08 Edmond Dant= es <edmond.ht@g= mail.com> wrote:
Hello

> I think you seriously underestimate impact of this in the current PHP = code bases where many applications depend on global state.
Do I really look like someone who could underestimate memory-related issues= ? :)

> Now imagine that some popular plugin decides to use async which change= some of its globals (like $post or $wp_query) during the suspension of the= main code. I would assume this could horribly break things.
Or for example, you run an old WordPress on the new PHP 8.5 and
everything breaks. Is that a reason not to release new PHP versions?
No, I=E2=80=99m not joking. That=E2=80=99s literally the essence of the arg= ument. If
something might break, then we shouldn=E2=80=99t do it?

This is a common story. There is a framework that is adapted to a
technology, and there is a framework or library that is not adapted to
it.
If a framework is not adapted, you simply won=E2=80=99t be able to use the<= br> technology. So why is this considered a problem?
However, inside WordPress you will still be able to use coroutines as
long as you don=E2=80=99t call WP functions that aren=E2=80=99t adapted. Yo= u can. So
why is this a problem?

I can use AMPHP inside WordPress and break WP.
So does that mean we must urgently remove Fiber from the language?
Because AMPHP uses Fiber, and AMPHP implements coroutines. And
coroutines break WordPress.
Asynchrony already exists in PHP. You can write async code today.
Which means you can already do all the =E2=80=9Chorrors=E2=80=9D you=E2=80= =99re talking about.
TrueAsync cannot change that. And no one else can change it either.
So why is this being treated as an argument against it?

> Don't forget that other code don't have control over the plugi= n and it might not even know that async is used there.
Exactly. This means that right now I can use Fiber plus select() to
write async code and break WordPress.
And I can also write a plugin that divides by zero and crashes
WordPress, and WordPress won=E2=80=99t know anything about it.

> So I'm not sure if this design is compatible with WordPress

Yes, WordPress is not compatible with asynchrony. I=E2=80=99ll emphasize again. This is not about TrueAsync specifically. This is about
asynchrony itself. Yes, WordPress and Laravel are not compatible with
concurrent execution. That=E2=80=99s true.
But are you **really suggesting** that because of this, all other
applications should be denied the ability to use it?
Moreover, would you deny WordPress itself the possibility of
supporting asynchrony in future? After all, WordPress can be
refactored. It=E2=80=99s not carved in stone.

Wouldn=E2=80=99t WordPress benefit from the performance improvements that async provides?
Wouldn=E2=80=99t WordPress plugins benefit from being able to actively
communicate with microservices and deliver the fastest possible
responses to JavaScript?

Is this feature really something nobody needs? If yes, then I have no
further questions.

Async is needed to increase throughput. That=E2=80=99s the purpose. If a PH= P
project doesn=E2=80=99t need it, it doesn=E2=80=99t have to use it. That=E2= =80=99s fine. But
there are PHP projects that do need it.

<= /div>

The point you=E2=80=99re= trying to make here is very clouded for me. Although you can use AMPHP to = break Wordpress, there is an extensive process of =E2=80=9Copt-in=E2=80=9D = for you to do that and it doesn=E2=80=99t happen naturally, accidentally or= unintentionally. You=E2=80=99ll have to setup a plugin that requires AMPHP= and write some code that will inadvertently break and never really see the= light of day.

Now there= =E2=80=99s 2 possibilities for us to go from here: my understanding of the = most basic concept of TrueAsync is still wrong OR the comparison you=E2=80= =99re trying to make isn=E2=80=99t relevant.

My understanding is that if this RFC were to be implem= ented as-is, you would be able to open any PHP file and write \Async\spawn(= ) and: nothing would blow up but any code inside the project that touches g= lobal state could silently misbehave. Is this not true?

My understanding of AMPHP is that things on= ly become async if you explicitly run AMPHP as your web server. It either h= as no effect if your application is running Apache=C2=A0+ mod_php OR your a= pplication 100% breaks with nothing getting executed at all. Is this not tr= ue?

I know you're tired of debati= ng very basic things, but from the conversation on the list, I think I'= m not the only one confused by this. We did talk about our desire to have A= sync on PHP-FPM and as far as I remember you mentioned it not being very us= eful, but that it would be possible nonetheless. This is the a core princip= le that matters a lot.

Here is a very simple hypot= hetical:=C2=A0
Suppose I run a website and I have very little und= erstanding of PHP, but I know the basics. Every Monday I run `composer upda= te`, do a little testing and deploy the website. Suppose next Monday when I= run `composer update` one of my dependencies (Package A) starts to pull in= AMPHP as its nested dependency. When I try to open my website locally it w= ill either have everything broken or it will just work regularly and nothin= g will be running async. There is no other option.
Now suppose th= e same example but with PHP 9=C2=A0+ TrueAsync. I do `composer update` one = day and test my home page and it works. But deeply nested somewhere there i= s a feature that will use Package A which then spawns a coroutine and leads= to my global state code behaving weirdly. It's not a fatal error. It&#= 39;s not very clear at all to me that something changed, but now my array i= ndexes are triggering DB updates out of order.

If = my assumptions about TrueAsync are completely wrong and that's not poss= ible at all, I think that's not clear for everyone. But if my assumptio= ns are right, then your comparison with AMPHP is not the same thing.
<= div>
--00000000000098151d06441a7db1--