Re: [RFC] Pipe Operator

From: Date: Sat, 14 May 2016 16:35:41 +0000
Subject: Re: [RFC] Pipe Operator
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16  Groups: php.internals 
Request: Send a blank email to internals+get-93332@lists.php.net to get a copy of this message
On Sat, May 14, 2016 at 3:33 AM, François Laupretre <francois@php.net> wrote: > Le 14/05/2016 à 01:36, Simon Welsh a écrit : \>> Sure, you could try to use the type of the value being passed in, >> but that ends up much more magic and then you run into the same >> problem with strpos, or password_verify, or a variety of other >> functions that take multiple of the same type of argument where >> order matters. > > Right. Some functions may have several potential arguments to substitute. In > this case, I propose we choose a position to use when the function is used > in a pipe and, then, create function aliases with different positions. > This doesn't strike you as massively over-engineered (and magic) compared to letting the caller explicitly specify position? Moreover, it only "solves" the argument ordering problem by replacing it with a function alias selection problem. -Sara

« previous php.internals (#93332) next »