Re: [RFC] Pipe Operator

From: Date: Tue, 17 May 2016 11:14:17 +0000
Subject: Re: [RFC] Pipe Operator
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-93369@lists.php.net to get a copy of this message
On 17/05/2016 11:55, Jesse Schalken wrote:
$id = $id
    |> StringList::decode($$)
    |> array_replace($$, $replace)
    |> StringList::encode($$);
To reiterate my comments from earlier in the thread, I think the "$id = $id" looks really weird here, and spoils the step-by-step layout - and, in this case, the symmetry. I would like to be able to write it as: $id
    |> StringList::decode($$)
    |> array_replace($$, $replace)
    |> StringList::encode($$)
    |>= $id;
Or just: $id
    |> StringList::decode($$)
    |> array_replace($$, $replace)
    |> StringList::encode($$)
    |> $id;
Sara, what do you think of this tweak, and my subsequent suggestion that the pipe should only be usable as a *statement*, not an *expression*? Regards, -- Rowan Collins [IMSoP]

« previous php.internals (#93369) next »