Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126590 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 qa.php.net (Postfix) with ESMTPS id 616611A00BC for ; Wed, 5 Mar 2025 23:50:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1741218461; bh=BYKKv4e3NMQzz/Yo8+iL+1xZOI9Ic1PYjKVbeVrqITY=; h=Date:Subject:To:References:From:In-Reply-To:From; b=d0uIqRgQtpLsp7rJj5Amu9PFqv2vtoI2Al6RMLWbkPGh2icVjF9u3a0kCH0AkV2Jy B2KQhHSuekJvtTqxVcJYxhssYzKRATx0tKFqD4qeJjCu0Pi6js/nUJEKBm9mphF/nc Ut93j+o5uakaT5M9y3uxnIGjQK/Mjv7Vsg2711KLBeYBWvl9wfmQMFojN8976q/OcS vDhQb48nTbVXwRWWYERuTeeVpyjisX4DDrQHM8fP6JQFWpPTCzgj0k670VzMmhTdI+ GS3Jux5XIVcu11EDOABCe2UoHM9pPPZGMUkVI6lvu1QI5q0/hAFurwMGVu5gkvIuFm rYfzNEiIi0x1Q== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9A640180084 for ; Wed, 5 Mar 2025 23:47:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) 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.0 X-Spam-Virus: No X-Envelope-From: Received: from fhigh-b3-smtp.messagingengine.com (fhigh-b3-smtp.messagingengine.com [202.12.124.154]) (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 ; Wed, 5 Mar 2025 23:47:40 +0000 (UTC) Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfhigh.stl.internal (Postfix) with ESMTP id 03EF42540187 for ; Wed, 5 Mar 2025 18:50:15 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Wed, 05 Mar 2025 18:50:16 -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=fm1; t=1741218615; x=1741305015; bh=AZWir5ogFzlZswBtimArgfu6BP4KllJ0hMt8jQAeZxE=; b= htpKFz5eBX36H8fDz2JPsXmAv/LvP1jxo9nuSfWmnF1MKR8y4o/AlYhrrvSnVjkW sffYNO3YQ2eb/4wlvNttGu0SE1fFIJKR6YRJ0MjK1UlJA5k+ODb1s4wiZYnMRo5P fSHdV8vqvsIl3L1XjYQ6zrig83K0I/FTZCYxSyMKA8DrzPlB21HjtXBpHx37zuqf i1ECSVg0jQkwrzvS2AQ5tO98b+8uoSTJaKheVqeqrndFtCYWOJlVfnfVDHrOtIal 6Ud0u8LXJzsxdA/mUrPLfGJPao3qnSTsCPb9eiAoaik0uonjnvXG0vjTHRrlE3Hp 9BIjhGjFHJY7Emhsdom6Og== 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=fm1; t=1741218615; x=1741305015; bh=A ZWir5ogFzlZswBtimArgfu6BP4KllJ0hMt8jQAeZxE=; b=j+ewdv09MsHfuyAyP 8qmhdIPqDJnk7hZOUT4n/Mndr9eeX8itk19NrEK7WPJ9gc+08m55QMZEikL4z/dk U9/OGtm5jiVqXYbPDkVHz9JVZv8kfBRYY0KdZ54xiuwE3knr/FR59W2iJ2sn4koB 6GhcA3ETeB1em3sI6nBiTqDUaUCL2oCAkVJzeGnmjMLOg6R8uIwV3nFJhnDRVZQe 5t/SuOIW2bk4pmXDZVndXAfVw5GEpaYC1x+0uoTFbMbutec+gu/B2jNDGdtqTOLG XUvXF80c8DAVOR10wRVjAAcAMEXigB6zmtNSQOK+mJJvqTLPP/d1d0gXOcqeIY9C EkfRg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddutdeivddtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefkff ggfgfuvfhfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpedftfhofigrnhcuvfhomhhm ihhnshculgfkoffuohfrngdfuceoihhmshhophdrphhhphesrhifvggtrdgtohdruhhkqe enucggtffrrghtthgvrhhnpeejkefghfeugffgtdeuheeggfdugefhudekjefhteegieej leehveelhfefvdfhudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehimhhsohhprdhphhhpsehrfigvtgdrtghordhukhdpnhgspghrtghpthht ohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepihhnthgvrhhnrghlsheslh hishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 5 Mar 2025 18:50:15 -0500 (EST) Message-ID: Date: Wed, 5 Mar 2025 23:50:13 +0000 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] PHP True Async RFC To: internals@lists.php.net References: <9964db8c-0ffe-43d5-8246-47fc76b07180@app.fastmail.com> <78a03dd0-fd4a-4f4a-ad8a-37e5704f06fc@app.fastmail.com> <23e162f6-54b0-4564-9d79-7b3bdc3d1ab5@rwec.co.uk> Content-Language: en-GB In-Reply-To: <23e162f6-54b0-4564-9d79-7b3bdc3d1ab5@rwec.co.uk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 05/03/2025 23:10, Rowan Tommins [IMSoP] wrote: > This is roughly what happened with Closures themselves in PHP: first, > decide that "$foo = function(){};" will be valid syntax, and define > Closure as the type of $foo; then over time, add additional behaviour > to the Closure class, the ability to add __invoke() hooks on other > classes, etc Sorry to double-post, but Generators are probably a better example: you can write "$foo = yield $bar;" and there are well-defined semantics; on the outside of the function, we represent the state as a Generator object, and make it implement Iterable to explain how foreach() works; but on the inside of the function, it's pure magic: $bar is passed into an invisible channel, an invisible continuation is created, and when it's resumed another invisible channel passes out a value for $foo. -- Rowan Tommins [IMSoP]