Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127561 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 946681A00BC for ; Tue, 3 Jun 2025 15:41:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1748965166; bh=2zQ/IAt41fKI6j272G/iravCymAhHmK4Rv7T5T2buME=; h=Date:From:To:In-Reply-To:References:Subject:From; b=Q14E3l1n4FHQQHKzrp5lk47QOthqA/Gfb5oWtgZXbL6pLeyfYhgrukFBoBXBV38il a/e0Y9Zwba8BIuhuvb8WAxcmOtD3XEb7+ZaGipdrulrLyod9F1KM+IJ6sSlUZTpUzK nQkrHIBeKd8Hbmn0rD6JvtnLvR5sDx/MOntJvicD+1VaEegZ+K7YclGm2dddyJdAOk BdaUyB4fgJQylhsqJYnGlw6qrcL63iHQj7niWwBCQNkvv2oB8R4v6izFcRIldKM5hR FvpWCdNWVNsFtuMDrfgDlGD15zjgddfbJVQEWlMvqtw2yu77ccxkYyO/jmeSNnalqm ZJ0iCKCTWYcVg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 719AB18004C for ; Tue, 3 Jun 2025 15:39:25 +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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from fout-a7-smtp.messagingengine.com (fout-a7-smtp.messagingengine.com [103.168.172.150]) (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, 3 Jun 2025 15:39:25 +0000 (UTC) Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfout.phl.internal (Postfix) with ESMTP id C8C9313802B4 for ; Tue, 3 Jun 2025 11:41:28 -0400 (EDT) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-10.internal (MEProxy); Tue, 03 Jun 2025 11:41:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; 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=1748965288; x=1749051688; bh=UlwlIDHc8+9yVqck3PQgJ 5uI+MH7FQHi5LPi99mGfiA=; b=VZWe4mT7PZVAW49eqe6E/749XmZyKbJo6Jlrd V1inxWfVSp80JtkgpJYB8RnIVKlNNiIibxKErubnko23EnN2LhCXQNMBxeOtbKxc 0DqV7Skkj5GpnDykj5S3AtyKQGsmFUcKbLA4QVS/qZPHoDvZ7j3YnW2O0a0q5571 8HitB9b/X6fQr30WJv95lDS0yvq4T007IuqqqnNkfZiQbvJSbWA5jWMZjEwJe1xh SXhqBokOVa9nBsG7+jXcid/KPtyvwfHRod2sysycesrktep9j7XTavPg/BHsZpod n0cDTgxbqyyxQN5U6ZYmX8bV3MpWYFVpI4nvi6BBIe02iZG4w== 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=1748965288; x=1749051688; bh=U lwlIDHc8+9yVqck3PQgJ5uI+MH7FQHi5LPi99mGfiA=; b=DGVhTY+kgSVr3a+mY TN6/A7X9/TPhviYHPoMFdNoSXbQVCgw0EsAAhQMWl8kHeT+7RsPbtEvdac5BtcoG zqJC4RxUEx6fRHGwZlBneG3klV/zmjl03Oh2ND6KO1WjDSkfog6MOwPDqn2AH/zB 4gk6ZZ4dpxrmj9rApuJOlhrkG6QPgNMdWnzRnmPChDAf+w6lDdy5RcXHt4R64z5a DIj8L74Lu3OPbB4jRao2+H6fsvrsMG107Rl968PTij1bfgwQzf+qxNV+w1bl+EYK Bfv2L5bW8Vmvld+HWfRUhrI+mw41rQJ/Hgkbj0aBwsBcX13GdzYR9L5t+oxElQMp ZtNHg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddugdeivdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenogfuuhhsphgvtghtffhomhgrihhnucdlgeelmdenucfjughrpefo ggffhffvkfgjfhfutgfgsehtjeertdertddtnecuhfhrohhmpedfnfgrrhhrhicuifgrrh hfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomheqnecuggft rfgrthhtvghrnheptddtvedvveehieefkeffveefleehjedtjefhteeugffhlefgudejfe dvudekgfevnecuffhomhgrihhnpehgihhthhhusgdrtghomhdpphhhphdrnhgvthdpfehv gehlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homheplhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhmpdhnsggprhgtphhtthho pedupdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehinhhtvghrnhgrlhhssehlih hsthhsrdhphhhprdhnvght X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 6C766700060; Tue, 3 Jun 2025 11:41:28 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 X-ThreadId: Tb59d627fb5f6e7a2 Date: Tue, 03 Jun 2025 10:41:08 -0500 To: "php internals" Message-ID: In-Reply-To: References: Subject: Re: [PHP-DEV] [RFC] Pipe Operator (again) Content-Type: text/plain Content-Transfer-Encoding: 7bit From: larry@garfieldtech.com ("Larry Garfield") On Tue, Jun 3, 2025, at 2:59 AM, Dmitry Derepko wrote: >> >> Pipe and compose are importantly different operations. I've had user-space implementations of both available for years in crell/fp: https://github.com/Crell/fp/blob/master/src/composition.php >> I'd love to have a compose operator natively in PHP, too. The RFC for that is already written, just needs code. I hope to formally propose it soon: https://wiki.php.net/rfc/function-composition > Hmm, that's great, but looks like we are missing something. > > 1. Would you propose the RFC to 8.5? I think it should be proposed with > the new pipe operator any way I am working with someone on the implementation. As soon as that's done I want to post it. Whether it manages to get into 8.5 at this point is an open question. > 2. RFC early feedback > > There is no big difference in DX with the new operator "+" for closures: > - + operator may be overridden in some extensions and it also may > implement __invoke. What's expected behavior? It will be totally unclear I expect the overlap there to be tiny, so it will rarely be encountered. As to which "wins", I'd think probably the extension. > - code examples from the rfc: https://3v4l.org/n7UB0 vs > https://3v4l.org/tOlft the first approach is better for me because it > may be batch-processed / combined / filtered / modified easily. So > taking my first message there are not so many changes: > https://3v4l.org/ncpEE > > Just try to imagine how to work with the composition and how it > perfectly works now: https://3v4l.org/ArK2O If you want to do it that way, Crell/fp has you covered, have fun. But the whole point of the RFC is to provide a native operator for concatenating functions. Decomposing/deconcatenating an already composed function chain is... not a thing. > By the way, RFC describes userland "compose" function performance > problems, but there is no suggestion to make it natively, why so? Uh. That's the entire point of the RFC? Make a native compose operator that isn't even a function. --Larry Garfield