Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129256 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 795AB1A00BC for ; Sun, 16 Nov 2025 04:56:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1763269007; bh=BVHhnfgBYmJGnPNgZ7MNfREZL6lqHUEAq3UXbxxr1bw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=DRtAfGAbcBoRH0oz4i+tulTGCERwxbr73QeQRyGoSUVQqyBQ9SLoogL1JwKyzg+8f /wXOqUcbeL5NguS4FQQ44azfCF9pjeeoVCUYQvV4XzN9wWFCOIcWjyN7k0Af7Plxoa Y2oplzWS1ieacaI1Lnj5F8PeBaYTnmD/RpWU4UN4NZR+iaTrJ+XQZEQg9gIe3bdEdw 3Hcx+ic63xJTzDUVmc2+r4VAOuN5hVBnJK3Gy6GYx0p23fKGKfm5UwkUq6r0GmWZA1 vJfWeqhte5XdjTwlyGSYTVfrYsJxoY5dXfXhTWLYDUX+sKzxQ1kPRrVqSR40meKX/y MKn4o95M3CYcA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3BFF21801C7 for ; Sun, 16 Nov 2025 04:56:46 +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, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-vs1-f52.google.com (mail-vs1-f52.google.com [209.85.217.52]) (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 ; Sun, 16 Nov 2025 04:56:30 +0000 (UTC) Received: by mail-vs1-f52.google.com with SMTP id ada2fe7eead31-5dbddd71c46so1280309137.2 for ; Sat, 15 Nov 2025 20:56:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763268985; x=1763873785; darn=lists.php.net; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=XNA1c1xT7h3LTAc3+4MkDEZRcBu2UAdwFhVP7GfcUgA=; b=GfAdr+HPYCc2rnGAaD34DSfSjxsSj3ek9lKM6qDPH5NVjVhb6bkrj/ms+NVvS1Ubke JmC7PZxKEiJtiY7GzaDRSQLTitcNzWxqjeWwLlPyLWL0PlVxpSSFtjk4ZjIbHWuERyTL VyJipWgAMcife1VFYTJec9OPVhDq9rbZpNrwW8o4/WD1C/BDeieNn6z3R3gAqq4DkJQu 1WTXgeefSgGSYEqHsHiHMOUmVPoeu9jKf3P8S/LxpSxE7V/o/7h6q+61HRSIPmNPGg0a Sr8fMaYR7umB9I7hCNJXa5f8n9Y2YHDc8cJPzjjlngX9rCTB7KEQfRVv0jU+eV+fFCLy Yg8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763268985; x=1763873785; h=content-transfer-encoding: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=XNA1c1xT7h3LTAc3+4MkDEZRcBu2UAdwFhVP7GfcUgA=; b=RK0iPXhJhYCqkvIrY8guTKm2rv0iRV1W598CN3O0I2oFFOKvDpHWV0UgiYYMPp4Jbm ZEJMqn9PG6hoKg4RPlintSFLPQ3IjTHrro4lMA10tlLM16WCJGcfRUu27+0g2XFgXPqI 9gV6iisBTZoioGK7zFyy7M8fQMjY/eHz50NHydYIRgHeUYeKNUqI/BnVxaSWQ9SQh6aG 1Ra6x70neohMdt5XSAlxIckA+tMYqUEN/g8JShwfW6B7W3f6p8SMgqUkRFOSW7BF97Oo 7DWzblbKi4djlQOjQ8X1sV072AE92D+Nrb7qJbPk/DnW1DFzHmnQQirjKkZDEl5LHV31 YoVA== X-Forwarded-Encrypted: i=1; AJvYcCUkG2fJl0AcgKqxYC3rEQweqBfHGgxTZX/CCqpR/chBQMxoEKmmctxGsCYCtm7+rHPXLGnaPWsd1ic=@lists.php.net X-Gm-Message-State: AOJu0Yz838l18zo9xMBBM7hrb580DVUSbe9/lWha55c9tGpIxj+t43zl BmKGO1rqqmhV9OZS6Ule6W9Np2NqQJbvemA9H+3Jo0c6H4qWt9q0b0Qt5zb/FsqoGlj3wJwDJwy xKGmdg5tkPoiipToD5KKpEMklgoJ+/rE= X-Gm-Gg: ASbGncv9Lufo11u8J3tprhUG4phyPhxBkD75a2K15GwYfvwe5ldaEf0ZAbe4FhfkGvQ O/t6W7AVXDsjjPouzcEnfpgHs5b1HC9d06cf7R3tELVaOaj219tTXnHQkalPWaj1D7rqRj52SI5 EQPjpDdB0B4emIsRq/6wonPaRF7+xRasMWhJHHVlQq8Wm0PMMmvRPfXxGoxwbXh8yMZF9ak7/ke XEyQPgMDaeZ6MhmJnaOLHvQk+bBDMSy4zzwlQ/o6ophQ8qikBdv36GcE9PxA4sdkQUM9aXkUaiv lZsgsgHMk49ESFPO6m+43/roqgo= X-Google-Smtp-Source: AGHT+IFuXr987FtmWY6kUNQ6QJZAtFscbrgeJlCizdttIJEndjkUJtPppDxqrDis7y9Lsz3hO+AtQ8Ae+9P0p/+l44Q= X-Received: by 2002:a05:6102:d8c:b0:5df:c10a:6680 with SMTP id ada2fe7eead31-5dfc5b6dfdamr3305188137.33.1763268985177; Sat, 15 Nov 2025 20:56:25 -0800 (PST) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: <6618a91c-5393-4f40-88b5-b5041ee09deb@app.fastmail.com> <3e0cf0a1-c1a3-4e05-97ba-0eeb7f559a53@app.fastmail.com> In-Reply-To: Date: Sun, 16 Nov 2025 06:56:13 +0200 X-Gm-Features: AWmQ_bkt3qBYa984eO4PC2guV5EAg1LRWWm76px3pqhAtMNO4gNT370Y-3zZh2s Message-ID: Subject: Re: [PHP-DEV] PHP True Async RFC Stage 5 To: John Bafford Cc: Rob Landers , php internals , Jakub Zelenka , Larry Garfield Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: edmond.ht@gmail.com (Edmond Dantes) > Now this array_map function potentially suspends. As of course does this = writeData(). And whatever calls this writeData(). And so on up the stack. And the most important thing is that the __execution flow__ for this function will __not change__. Do you understand this? This is described very clearly in the RFC. > Because this RFC *changes the contract* out from every line of php code e= ver written. Code that used to be strictly synchronous now has async suspen= sion points it didn't ask for. It=E2=80=99s not the RFC that changes the contract. It=E2=80=99s asynchrono= us programming that changes the contract. And that lies outside the scope of this RFC, because once a developer starts using asynchronous programming, they must accept the global contracts of asynchronous execution. And this RFC does not deny that. > To repeat, a core premise of this RFC is: Sorry, but I=E2=80=99m not going to repeat points that were ignored. My goa= l is to help you understand the text of this RFC. I have no intention of banging my head against a wall. > With this, the RFC implies that I should be able to take my synchronous P= HP code and run it in a coroutine with other synchronous PHP code, and it w= ill all just work. But obviously that won't work. For most cases that=E2=80=99s exactly how it works. In human language, there is no definition that cannot be twisted and misinterpreted. Why elevate this idea to an absolute while ignoring common sense? I have no idea. What=E2=80=99s the purpose of this discussion= ? It seemed to me that the purpose of the discussion was a professional conversation, not playing with meanings. > I understand that a different interpretation of this wording is, "well, t= hat code does exactly what it did before, just that with coroutines, that h= appens to be broken". I have no idea what you=E2=80=99re talking about. > Of course colored functions are inconvenient. But it's necessary or else = you open to a whole class of easily avoidable problems. _Those_ problems ar= e _much_ more inconvenient than colored functions. I already discussed this topic back in March, and I can briefly summarize: the absence of colored functions in PHP is the only viable way to implement async. > Code that was written to be synchronous should remain synchronous unless = it is explicitly modified to be asynchronous. Practice has proven the opposite. > What this says to me is, "Here's a foot-gun. Please use it responsibly." A footgun implies something hidden or implicit. Asynchronous programming requires the developer to handle memory correctly explicitly. This is equally true for all programming languages. It does not relate specifically to this RFC. > especially when we have the knowledge and experience from other language= s to draw on and do better How do you plan to draw on the experience of other languages if you=E2=80= =99re ignoring the experience of asynchronous PHP that has existed for many years? If you truly wanted to rely on such experience, there wouldn=E2=80= =99t be this discussion.