Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129367 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 15B761A00BC for ; Fri, 21 Nov 2025 14:16:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1763734576; bh=TqKBe4IDgXx+Zt8OygKReFr1f5TXx6rdf8JlqYZfgMw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=NCyuieRZU3kRQIwiDzR4Ud0hW5MQM967j9SUb0+FKiGSt/DFtSm8G4Ms8DqMDMgtu ktUZUe4DtzxvzKowahpL8XIbK7h4sT9qpNZ2ltF+GyBRBp/cvaARXXEwyIjncxvrvm C6Biq9OiIATMUeZ9ZIbKVw0UYhAS+TyGwpmz3H9jt8m+BxUePpkfX4T1BYOM0wv87a svxVYSo0H5mbu7kvPWkrwP2FoxYfQyECnVQ2Vn0mmQcyJqTeDig8S4pVb8fu8ldTQH ZZyauNLoaAG+tLJhPRtxNu8TIp2eM24OFcxDIqZb5PE8xc8Tbg5YLndbmNCqCRp1oZ 7/c6L0kNTV+kQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 14AF418058B for ; Fri, 21 Nov 2025 14:16:15 +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-ot1-f46.google.com (mail-ot1-f46.google.com [209.85.210.46]) (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 14:16:14 +0000 (UTC) Received: by mail-ot1-f46.google.com with SMTP id 46e09a7af769-7c78003b948so179244a34.1 for ; Fri, 21 Nov 2025 06:16:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763734569; x=1764339369; 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=TqKBe4IDgXx+Zt8OygKReFr1f5TXx6rdf8JlqYZfgMw=; b=isVl3fZNOrRfSpO/1+kF/deXnJgQeQfZ/QxwcoC25Bv2fAbH6AoSXQCAQdA4d/vIpj gYZVxxrN53mn7VtEN949oOCiPh1kJnbaegAPBtAYj2xtZh2ob+VU3Hj+/LEkBqEY37ag sr7fM2KvTF3otNGde2B/hg6/diCNc8KnT3w+51mP5YW5wLmVgq0sVDjUKO6PGb+FGizg FLQl/qo3rpi4AOsQwo3a/5ziRWmbo6rHKR9gVNP/xvN2eyjOOpRRyLiZMnp7bMNYcj7L BXCQie3edxZ7SKBmu65r7Kq9ylLYluXzhpmiqFruEgV8n9xUJWtY/Oqs8+pH9o6W8X6N Pkmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763734569; x=1764339369; 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=TqKBe4IDgXx+Zt8OygKReFr1f5TXx6rdf8JlqYZfgMw=; b=Yl+NEpSvLEuYamXTmACC1Hyf0miAzlg227uUF+ntDRvERgX7F/1X4kBLODnBxDq81j 4lrn50MR8Kn/Bja1VZsViSeQ0sWQMb3vtPJovcFML+VmuLk88BjXKNMCs46teNBeocf6 IpORZ1LtKU8Hri4XmQPFOtTfE3ViRQBsDOeBwklQrpMhFqPMvQfXI8mh4BQhVDuFYJKa K73t02fQ5GS29jFltyA65BmR9b97Yp908HIvM+xbuYp5hG/iacqFgh2j+pVAXT/0Xmrm CdxhBpQ8Pz571++y7ZJWj63qcDrqCsxua7zTGiObLnKSjUQ39TonZq3drUN2L/nXNgAb KXpw== X-Forwarded-Encrypted: i=1; AJvYcCUcBMWGZu8oXjuPxT954rNCRIe0w/cclMVp0ovaFRCpz+UmaBTk90Z3mt/zsX79HixnG+MEYmI+c9E=@lists.php.net X-Gm-Message-State: AOJu0YwmgsveQnQZenu4lPbZZUWcDSiOnRHnCJdQ0pZ7/rz9CG2XjV4d kbDQP7X9R+X7aJm2fuyUcDRl6QdhsafXMf0VuO75xnXj+SmFysaKwY+237AsjxMevhFFTXju6e8 dAPpBr9L/YWqgP67ilnkAup5ITifpHa2P8K05 X-Gm-Gg: ASbGncusMGMuQwCcDe63o74atGhxwm1rFGn7JM9OfEbEU8nHoVbiLWq+WNaQo8MePwc kBFDdN5pFiRCnKn42Gvs7WD/Dr/LJX/XU+pyoVtbtWyPCEY7WXR1jyPEMUCAVvT1yfiu82WD0/F 5FBB5u52l09ky1b6eCw4LRw8vvEwlW9W2FtnJCFe+AcNUrYj1OgjfRDl1HxWBXr53rJN189HM3H Wzmqda8/ZBjEE/ZI7TO3TcB0sVAgp9mK3fHG5nmYt0Iw+g/FMIUPrl1XtrgP5xmjTJivWpoQ091 TQAsjyg7teR6n0gQvNVOHGVvhGA= X-Google-Smtp-Source: AGHT+IFxaLkQ9ODLOh6E4931GUG6a8IVV5xZLrXfFcX+QbTrAtJrhWUKXZWtjeJIbd1ngUXYSTRTNZSz84MeY9y7eIo= X-Received: by 2002:a05:690c:ec5:b0:789:5016:ec32 with SMTP id 00721157ae682-78a8b4ada02mr16154417b3.3.1763734259396; Fri, 21 Nov 2025 06:10:59 -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 11:10:21 -0300 X-Gm-Features: AWmQ_bmbn-kiN6g7o1X8jSO_FDvaSmdFQHtblOaet4D6pjCzyQEx7e9_KSFCht4 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="00000000000002743e06441b6215" From: deleugyn@gmail.com (Deleu) --00000000000002743e06441b6215 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Nov 21, 2025 at 10:45=E2=80=AFAM Edmond Dantes wrote: > > I have a mental habit: when I write asynchronous code, I always assume > that any object shared between coroutines can change at any moment. > Similarly, if you hand off memory ownership to another class or share > memory, you have to keep in mind that there is a chance some developer > might accidentally do something wrong. > > The only difference between synchronous and asynchronous code is that > you don=E2=80=99t have a precise moment in time when the change happens. = And > yes, that makes debugging harder. It makes finding bugs harder. But > it=E2=80=99s not something fundamentally new. > I don't know how else to describe it, but I decided to give a last attempt here since you mentioned your mental habit: having a mental habit about async code makes perfect sense. What I'm trying to say is that most PHP developers don't have that mental habit and that's not a problem because Async code in PHP doesn't come into your project out of nowhere. With `spawn()` being native, anytime you do "composer update" your project may start running async code without your consent and without warning you that you should go through a mental habit that you don't even know exist because you never had to worry about async code before in your life. Having spawn() be an extremely easy way to start running async code is a great feature (not a bug). But the very first thing that seems to be missing is: I'm a dumb PHP developer that don't know and don't care about async php and when I upgrade to PHP X.Y, how do I keep my project always-sync without risking one of my composer packages suddenly calling spawn() and causing bugs I have no idea how to even begin to understand? ini settings are very frowned upon, but for the sake of a conversation, we can think of it like that. if I do async.enabled =3D 0, then nothing change= s for me. Having this opt-in/opt-out control would mean that a broken website caused by spawn() only happens if they decide to enable async and they can start learning and developing their mental habit about how to work with async code. --=20 Marco Deleu --00000000000002743e06441b6215 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Fri, Nov 21,= 2025 at 10:45=E2=80=AFAM Edmond Dantes <edmond.ht@gmail.com> wrote:

I have a mental habit: when I write asynchronous code, I always assume
that any object shared between coroutines can change at any moment.
Similarly, if you hand off memory ownership to another class or share
memory, you have to keep in mind that there is a chance some developer
might accidentally do something wrong.

The only difference between synchronous and asynchronous code is that
you don=E2=80=99t have a precise moment in time when the change happens. An= d
yes, that makes debugging harder. It makes finding bugs harder. But
it=E2=80=99s not something fundamentally new.

I don't know how else to describe it, but I decided to give a la= st attempt here since you mentioned your mental habit: having a mental habi= t about async code makes perfect sense. What I'm trying to say is that = most PHP developers don't have that mental habit and that's not a p= roblem because Async code in PHP doesn't come into your project out of = nowhere. With `spawn()` being native, anytime you do "composer update&= quot; your project may start running async code without your consent and wi= thout warning you that you should go through a mental habit that you don= 9;t even know exist because you never had to worry about async code before = in your life.

Having spawn() be an extremely easy = way to start running async code is a great feature (not a bug). But the ver= y first thing that seems to be missing is: I'm a dumb PHP developer tha= t don't know and don't care about async php and when I upgrade to P= HP X.Y, how do I keep my project always-sync without risking one of my comp= oser packages suddenly calling spawn() and causing bugs I have no idea how = to even begin to understand?

ini settings are very= frowned upon, but for the sake of a conversation, we can think of it like = that. if I do async.enabled =3D 0, then nothing changes for me. Having this= opt-in/opt-out control would mean that a broken website caused by spawn() = only happens if they decide to enable=C2=A0async and they can start learnin= g and developing their mental habit about how to work with async code.

--
=
Marco Deleu
--00000000000002743e06441b6215--