Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:128890 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 32BA51A00BC for ; Tue, 21 Oct 2025 22:07:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1761084458; bh=A1S8HfBIxCJWRrnNs/5tv51jM2yEla+QdRFGzylvwUQ=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=O+T+d3eGavTD4AbQ4DVjw3ZG+jgpki76G/4yyI0x0tI9TW4x+vA8tkfv3ggEYPdcZ ob/+tG905z/kl5I28VJxccxPBy0MiaBl27lGEtMxgoRzK2beQ4qGFFmocsiPAsSkym 17xz16nJemP99mr4z/ChASG80RK9nuLp7+Q1URYG0MGJy+eZz3Ho6zKN9ey5U/w9bB xco50r7kp1QJziUR/WYnuNaheP9Fq5+hlm22NGErnXTZmiaybujm4BMA3BwMySoWjG RoTGufLCOdyFqbeW47K3lZz+GlJGnM1terc+7XdNCwzOhhqKKhFV7/3hSqhBLl2Cr8 HplDUIQG+PFGg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2CE701801EC for ; Tue, 21 Oct 2025 22:07:38 +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=3.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_PASS, SPF_SOFTFAIL autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from xdebug.org (xdebug.org [82.113.146.227]) (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 ; Tue, 21 Oct 2025 22:07:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1761084451; bh=A1S8HfBIxCJWRrnNs/5tv51jM2yEla+QdRFGzylvwUQ=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=AZVbZBbb7KVFXl5OWitSh+AqzbljWJh4Tm+IMWi9YDXRyzMfZH9mXw1ce2Vt+d6qJ Oun0LX4/6ZLzgxlUkuDsh24vlz1GetJQfRC5k3LHPxFrINHK7RrzAItAnqNW8VEsBw WzO100Z2Er8AaXlpRnVI+AMYbpe3txjrWAJ9MB26Z4IrlNdoWxC5mD9ZOPrAdSFlyI CWDzq3cpUL7pl02rTPHwF5OupLmQZ2eWLJcr6vDJN0JPqjBcz6bAIdRt2RkISGBEJ9 34nCC5PP/VIgr8Tn6RrZ3wM8K6huXly1sZ5h9v8kJfo+J252DRwuGYd++tx5MS8OHT aV97NqmxZf+Mw== Received: from localhost (localhost [IPv6:::1]) by xdebug.org (Postfix) with ESMTPS id D702810C070; Tue, 21 Oct 2025 23:07:30 +0100 (BST) Date: Tue, 21 Oct 2025 23:07:30 +0100 (BST) To: Edmond Dantes cc: Larry Garfield , php internals Subject: Re: [PHP-DEV] PHP True Async RFC Stage 4 In-Reply-To: Message-ID: <236bd059-4ab5-1798-17f0-233be93aaaf4@php.net> References: <14f591d4-aa1e-49dc-bc20-03cb493dc20c@app.fastmail.com> <4f9b8dfd-5415-3df3-fda9-33a8716c57c1@php.net> Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-670500562-1761065910=:4580" From: derick@php.net (Derick Rethans) This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-670500562-1761065910=:4580 Content-Type: text/plain; CHARSET=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Hi, I have now read more thoroughly through the whole RFC, and I am less=20 happier with it than I was. On Tue, 14 Oct 2025, Edmond Dantes wrote: > On Tue, 14 Oct 20205, Larry Garfield wrote: > > > It's vastly improved from the first version back in the spring, but=20 > > there are still numerous footguns >=20 > Which specific footguns? $scope var? There are many as I see them, to name a few: - A new ini setting =E2=80=94 we would be much better off picking a value, = and=20 stick with with it. - Showing warnings when all sort of issues happen. - Indeed, the passing around of "$scope". - "A good practice is to ensure that a Scope object has only ONE owner."=20 =E2=80=94 that really ought to be enforced - "Passing $scope as a parameter to other functions or assigning it to mult= iple objects is a potentially dangerous operation that can lead to complex bug= s." =E2=80=94 so this isn't something a design should even allow. - "Awaiting a Scope is a potentially dangerous operation that should be performed consciously, not accidentally. " =E2=80=94 a design should prev= ent PHP users from making potentially dangerous situations. - Disposing etc, I don't think I even understand what you're trying to do w= ith this, considering warnings, zombies, etc. - "Warning: You should not attempt to suppress CancellationError exception,= as it may cause application malfunctions." =E2=80=94 again, a good design sh= ould not require our users to have to think of this. - Hierarchies of scopes make for a lot of complexity. I doubt whether this = is useful in most cases. There is a lot of complexity and I still also think this RFC is trying to d= o way too much. PHP is *primarily* used as a web language, and the goal of ad= ding concurrency into it should make the live of web developers easier. This see= ms to be designed fo running PHP as a long time running script/event loop. We = have web servers and FrankenPHP for that. In addition: The RFC also doesn't describe how scheduling works. You call it "out of=20 scope", but as this is needed for this whole concept to work, it very=20 much ought to be in scope. In the second example of "Coroutine::onFinally" there is an onFinally() cal= l without object. Under "Tools", there is: "getSuspendFileAndLine():array =09Returns an array= of two elements: the file name and the line number where the coroutine was las= t suspended. If the coroutine has not been suspended, it may return empty string,0." Returning bogus values (empty string, and 0) isn't a good idea. Instead, the method should probably have a "?array" return type. "The format of this array depends on the implementation of the Scheduler an= d the Reactor." =E2=80=94 Spell out what these are, and how they're supposed = to work. We cannot make decisions on non-complete information. "Therefore, using concurrency is reasonable only for long-life scenarios implemented via CLI." =E2=80=94 I thought the whole point of this was so th= at developers can use concurrent things during their *web* requests =E2=80=94 = for example running several queries at the same time, or doing multiple http requests. Isn't that what you would expect people to use concurrency for? I don't understand why the "NGINX Unit integration example" is part of this= RFC. > > I very much want to see it evolve further in that direction before a vo= te > > is called and we're locked into a system with so many foot guns built i= n. >=20 > Such an approach would require more changes to the code, and I don=E2=80= =99t > see how it would protect the programmer from mistakes any better than > this RFC does. In my opinion, it was not wise to spend so much time on the code (beyond prototyping). The role of the RFC process is to hammer out a good feature f= or PHP, with the code being (mostly) an implementation detail. > My position is this: **TrueAsync** should support the best patterns > for specific use cases while still remaining convenient for the > majority of tasks. The "Goals" describe what you would like this feature to be, but not *why*.= The RFC does not describe why this feature is important for PHP for specific us= e cases at all. cheers, Derick --=20 https://derickrethans.nl | https://xdebug.org | https://dram.io Author of Xdebug. Like it? Consider supporting me: https://xdebug.org/suppo= rt mastodon: @derickr@phpc.social @xdebug@phpc.social --8323329-670500562-1761065910=:4580--