Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129285 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 1356D1A00BC for ; Mon, 17 Nov 2025 20:39:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1763412000; bh=52eWj7mrlDsd0MAwzsaWPuvQ8Gez5XiBByQId8YhvDs=; h=Date:Subject:To:References:From:In-Reply-To:From; b=WZoZ+tNhWLL0TjUUmXtl7y7N+Gj/QVYv7mw/1DCWLQnUEuQfTygFs6VIPDWtN+r0z zARZL/F+WSMTrwBj+ItykdHfvNd6Ub2aQ2K1SIzPKmB7+L+ZeFdqYUjmx/uGa1gwwF 3lUoUG6SU+Ahs9cBBuUmW5xdNOTKUtFNObGZCALfiXkxISwRW+rRhlW0PQLI29OOmZ 0BXcU8aagKBvGBPZ6AVqmHMi2HcLLTlxMubZP6d7fdvtP7WOM6kpBbDTjERS4ZwnK5 Xypne3CsNrwSyrnoK6zw6Mv75ZdnNE/RB4+QJ4KCvMdAdEzGBDNngKbULA4vuyIV8B 9iidylWxk8jdQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 185F9180088 for ; Mon, 17 Nov 2025 20:39:59 +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=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from fhigh-b7-smtp.messagingengine.com (fhigh-b7-smtp.messagingengine.com [202.12.124.158]) (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 ; Mon, 17 Nov 2025 20:39:58 +0000 (UTC) Received: from phl-compute-12.internal (phl-compute-12.internal [10.202.2.52]) by mailfhigh.stl.internal (Postfix) with ESMTP id 254DF7A01BC for ; Mon, 17 Nov 2025 15:39:53 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-12.internal (MEProxy); Mon, 17 Nov 2025 15:39:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1763411993; x=1763498393; bh=YQpa3Wng2PM8u386RIYhN2nQqLbBtQihV//t1UKpUOU=; b= De6FLlIrN1ZrcMGOpqi2gc7/fiuBtxVcPqjf5nLFCa+rTmi0wlb/2HBLj9SPebf0 YXZ/aRx5i0FgLKM4TiJEQONeMY5hPAIzObFWrapLdfMyHtGYwCa0IP/cT4ABixjl 4vXvtw0p+ywGLT533kZRivAtDpNuKOJ5c61l87qOCIUes8+blzWjm11qGzxY+1DW M+v4/LlTVtuETpfqh1wQ+QW8oCq8kwQt7n9v9UuV5LWQedNL+wJztvrBI40L9AkO 1Z/K5mraP43wraSDO6AK6RaSAjeLl+yAGANEZbc6Rg9QI1DxVrzjvZiXrnDIYUZp 5GEhkkcOpxtqqdSeRz8hqg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1763411993; x=1763498393; bh=Y Qpa3Wng2PM8u386RIYhN2nQqLbBtQihV//t1UKpUOU=; b=zNtoF2ZtbD6FN7mLL bvdWsE5fkymbZStse3AeEOmCajmJL45wzYme2VTaC5jsZfhX7aJKRFl/gdz9w7/I Bdy1rmH2Fr3J3h7RlWuY4g+gHaWN5QNDwXQUiVhYKjtYjms0RQb5DrzylO4C5uUi 6VOD3DGD31GI74zWIvq3HFmqn6d5sbi1scgvZ15+AcUBvZJWpKF3Ac8p22uuCBIL SCzoNNuTTtlC1mK5OHBqxGpd35bNC4VWV0YxFyU/SMAJnOu+BE//7/heoxCwDako fylQ2l0bykeFupOq/RGQPQ6v0OiBOlKpZcCXeeRFCajAKiLdx1cNVWPn1EB9xrDF Zlmaw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddvudelgeegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtkeertd dtvdejnecuhfhrohhmpedftfhofigrnhcuvfhomhhmihhnshculgfkoffuohfrngdfuceo ihhmshhophdrphhhphesrhifvggtrdgtohdruhhkqeenucggtffrrghtthgvrhhnpeffke evudffuddvheejvdefkeelfedtudegfeehjeduheegieduffeggeegveefheenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehimhhsohhprdhphh hpsehrfigvtgdrtghordhukhdpnhgspghrtghpthhtohepuddpmhhouggvpehsmhhtphho uhhtpdhrtghpthhtohepihhnthgvrhhnrghlsheslhhishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Mon, 17 Nov 2025 15:39:52 -0500 (EST) Message-ID: <563f3bc0-d7f5-4bb9-915c-1d63601d2300@rwec.co.uk> Date: Mon, 17 Nov 2025 20:39:51 +0000 Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] Re: PHP True Async RFC Stage 5 To: internals@lists.php.net References: <6618a91c-5393-4f40-88b5-b5041ee09deb@app.fastmail.com> <3e0cf0a1-c1a3-4e05-97ba-0eeb7f559a53@app.fastmail.com> <41c5eed0-dd1b-4ea4-99cf-f6d16682bd7f@app.fastmail.com> <08303459-b4ab-44a8-9795-0fb7f82914d0@app.fastmail.com> Content-Language: en-GB In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 17/11/2025 09:49, Edmond Dantes wrote: > Regarding the hybrid function-tainting model, it is designed for > compilers or static analysis. For PHP, it could be implemented like > this: > > ```php > #NoAsync > function myFun() { > asyncFun(); // Error <--- > } > > function asyncFun() {} > ``` > > This is a solvable task for static analysis. As I understand it, Larry's suggestion was not to prevent marked code from calling into an async function, but to force the called function into sync mode. Imagine you have code like this running PHP 8.4, using a third-party SDK library: function myFun() {     $input = someThingWithSharedState();     $data = SomeApiSdk\someFunction($input);     someOtherThingWithSharedState($data); } Then in 9.0, we get True Async, and the author of the SDK starts using async I/O functions somewhere deep in the library. Without any special marking, other functions can run between the statements in this function, completely unknown to the author of myFun() If you mark it as "NoAsync" in the sense you've described, a static analyser can point out the problem, but you still have no solution, short of forking the SDK and removing all async code. Larry's "sync" marker would be a change to *run-time behaviour*: when myFun() begins, the scheduler switches into "linear mode", until the end of that function. In that mode, when a suspend() point is reached, the scheduler immediately resumes that coroutine rather than choosing a different one. If this was marked by an attribute, you could add it to code that supports both PHP 8.x and 9.x, and the code would run the same in both versions. Aside: I definitely think that if/when True Async is added, we should call the resulting version PHP 9.0 not 8.5 or 8.6 or whatever. As well as potentially requiring users to review code for dangerous cases, it would be a huge new feature worthy of the branding of a major version. -- Rowan Tommins [IMSoP]