Re: [RFC] Function pipe operator

From: Date: Tue, 21 Apr 2020 04:20:27 +0000
Subject: Re: [RFC] Function pipe operator
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-109738@lists.php.net to get a copy of this message
Hi! > https://wiki.php.net/rfc/pipe-operator-v2 Just a small pedantry note - in a comparison section, the RFC compares this syntax to function composition. But this is not function composition. This is a syntax sugar for calling two functions one after another, not operator that produces a function. It sounds pedantic but it's rather important distinction - if |> is composition, than $foo |> $bar is a new callable provided $foo and $bar are callable (but no function is actually being called here!). If |> is call syntax, it's actually the result of calling $bar($foo). So comparing it to function composition is a bit confusing. Otherwise it looks OK to me, except the syntax for calling functions and methods is a bit awkward, but it's not the problem of this RFC I imagine. -- Stas Malyshev smalyshev@gmail.com

« previous php.internals (#109738) next »