Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127552 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 BDDEC1A00BC for ; Tue, 3 Jun 2025 07:59:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1748937448; bh=YCDIru3xlpfL/oX99A34BsMESI1rXKYod+H02Tmp3B0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=kKBviAChVk/qTe9kn5lNw67uqJhe/2QU4SS2hCwnJa7YAz3YVYYCzhmyQT0i9ymS2 6A+Ih9loh4JzOPau966zojk8xaxL9gRJIH36YQOiHudIuVE0IEA5NHSDwRHqB2jLYg Dodiqrw48v63iY5Xykgzi/k9ykKsHesCY0gqiFpqkrNaTMj+B2tMU3sDzkX7oSMpPi 4l5Z+9VCjbQjI1q0oSEm4o8yGrpLpcpfbS0z5IW8afuIfaIYfU7gMDoGw7M3StRcY1 cSR0sKUmCrkcUeEV2LI75FF7GzZAT863ObWRxqEyLcoyxAbmp/6iW+FKxaPxf6vlRp FiQtHJMCtEaXA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 91CA6180041 for ; Tue, 3 Jun 2025 07:57:27 +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.7 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS 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 mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) (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 07:57:27 +0000 (UTC) Received: by mail-pj1-f41.google.com with SMTP id 98e67ed59e1d1-312116d75a6so4380947a91.3 for ; Tue, 03 Jun 2025 00:59:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1748937570; x=1749542370; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Zbn6ZhlhaN8RkKWmNz0xK5KQ1wUGs7GWDMwW8ObvdwA=; b=bKO/a5AdFOYTfJlHiuYqjiGVYnfU7kCNPxBXOcVAs9brud2lQod2mosVT9jom0xWDo oYRGYoMfD/z0DEaax5W4H/ZQVHpJkhVysEDoaqSf32juEd+19YJK4rmcDVSWy6jMuGvr UnBYQZem8kX8vUepjTHcF9ddtIZyJnrZPcaqir3/wmwt5ATBdXsgbf5K84phR1ES33Kb ri/NK1iOmoTnAnTglLgJoWJ3jviUGRMLkR/W4H7OgC1zSofaOHvlOrszqZdTJYyvN7um 66N/FFWgPUTQExR902Fu0981cKEuvYloJotEqJhlhWowHClyBPsQUiTEDsnWQwKtYpgt UzzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748937570; x=1749542370; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Zbn6ZhlhaN8RkKWmNz0xK5KQ1wUGs7GWDMwW8ObvdwA=; b=jIsDl/LsDz1gcHQvqVV/1QYx1TGnGvZSc+85CodmDdvHWpDd9FQKvr3ddUEZVdIugx 67hJxV6s9wyi8XyVkiBqWDLgJz6jP++oO5xUuyU6wQ56V7l2PJoxWkFJusMDn1cUcwAL fWrLBdoUGegegxyiXMXtBpjmAHkBK7tukdlA37R7bFsVDq1/RocZ8Bq7ty5prVY5IAhF 6cehUqaXuxtIbJMAZKg1N6X3s2+1HLP3i6qadq3K21sJJ+pKN5YLbUtsBxgMEC2kLtRa cSpfEmnjaB45vnCoroRF7WrF7GjQNF94wAPRqqnJ/jhYAe5yo1dGyejTOKR5NTz9e+9m lTrQ== X-Gm-Message-State: AOJu0YzCNf468+lOqDb4PyusfEVSI/59vxyWUNOSKOa4YaR1WYobdDdx 72I6NzS2kz4JGoMthjAyyClP8xBWKjDJEElxp2cwSuCJyyvUObfKhZy4RV32iHC8mxdzOEa93z8 5JZ7k6gT00wBb+xH241aNN6gey3D8F1iiFwwOH9I= X-Gm-Gg: ASbGncsMUJ4SIsBlvEsiSS1mqKrv7BtWGfiFZjlcfA2aUOYdCYG8JgBnz38fIq9yNDz R4TKqYp1j/A+XftfJOJHWoxYgGh0AEkYYJDyKAm8E46KVTl8dr6jGgO5ZfcTsXOo3q1ym0jsFyE OyjqfFzN7mXO1KRzmfrOiytgolrZPpbxIG5g== X-Google-Smtp-Source: AGHT+IHa26cRzmUXTwgdaTGvAwoE0y37whkMAWi2BN31bJAbtKktWW9kbTMXlFlvkChR4brKj6h7CN+W9R9grtSVxgM= X-Received: by 2002:a17:90b:4a85:b0:2fe:85f0:e115 with SMTP id 98e67ed59e1d1-31241b8841amr21098388a91.26.1748937570233; Tue, 03 Jun 2025 00:59:30 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 3 Jun 2025 10:59:18 +0300 X-Gm-Features: AX0GCFsS6NSsSjMlpTx_qZ80JyIav_ZaNUozJa_6--2lxaxbu2K9nWEK-FCVtRY Message-ID: Subject: Re: [PHP-DEV] [RFC] Pipe Operator (again) To: Larry Garfield Cc: php internals Content-Type: multipart/alternative; boundary="0000000000009bb25c0636a642c3" From: xepozzd@gmail.com (Dmitry Derepko) --0000000000009bb25c0636a642c3 Content-Type: text/plain; charset="UTF-8" > > > 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 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 - 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 By the way, RFC describes userland "compose" function performance problems, but there is no suggestion to make it natively, why so? -- Best regards, Dmitrii Derepko. @xepozz --0000000000009bb25c0636a642c3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Pipe and compose are importantly diff= erent operations.=C2=A0 I've had user-space implementations of both ava= ilable for years in crell/fp:=C2=A0=C2=A0= https://github.com/Crell/fp/blob/master/src/composition.php

I'd love to have a compose operator natively in P= HP, too.=C2=A0 The RFC for that is already written, just needs code.=C2=A0 = I hope to formally propose it soon:=C2=A0=C2=A0https://= 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 wa= y
2. RFC early feedback

There is no big = difference in DX with the new operator "+" for closures:
-=C2=A0+ operator may be overridden=C2=A0in some extensions and it also m= ay implement __invoke. What's expected behavior? It will be totally unc= lear
- code examples from the rfc:=C2=A0https://3v4l.org/n7UB0 vs=C2=A0https://3v4l.org/tOlft the first approach is better for me because= it may be batch-processed / combined / filtered / modified easily. So taki= ng my first message there are not so many changes:=C2=A0https://3v4l.org/ncpEE

Just tr= y to imagine how to work with the composition and how it perfectly works no= w:=C2=A0https://3v4l.org/ArK2O
=
=C2=A0=C2=A0
By the way, RFC describes userland "compose" function per= formance problems, but there is no suggestion to make it natively, why so?= =C2=A0

--<= /span>

Bes= t regards,
D= mitrii Derepko.
--0000000000009bb25c0636a642c3--