Re: [RFC] Pipe Operator

From: Date: Sat, 30 Apr 2016 18:57:40 +0000
Subject: Re: [RFC] Pipe Operator
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-92999@lists.php.net to get a copy of this message
On Sat, Apr 30, 2016 at 11:41 AM, <lester@lsces.co.uk> wrote: > God I hate crap software ... TRYING to reply without top post ... but Samsung is incapable! > > What I was trying to comment on was that trapping that no result is returned may be what is > needed, so handling the empty array rather than a null return just means having to remember what you > do use :( > What follows is a terrible idea and I don't mean to propose it as a solution, but to spark further conversation: $result = getData() ?> doStuffWith($$) :> actOnFailureOf($$); Basically, a chaining ternary such that the result of the condition expression propagates to the true/false expressions. Not really the same feature at this point, but a similar chaining-friendly take on the standard ternary. Just thinking out loud... -Sara

« previous php.internals (#92999) next »