Re: A little syntactic sugar on array_* function calls?
| From: | someniatko | Date: | Tue, 25 May 2021 10:22:02 +0000 |
| Subject: | Re: A little syntactic sugar on array_* function calls? | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-114578@lists.php.net to get a copy of this message | ||
> The pipe operator feels like a poor solution while
-> would
> do exactly what people want.
Could you elaborate? Adding method-like array access functions with
only few predefined functions, and only for arrays looks very limited
in scope, while the pipe operator would allow applying any existing
function, be it internal or userland one, to any type of variable, not
limited by arrays, having the same "fluent api" feel. Also it clearly
distincts between object method calls and function application, which
is a plus for clarity, IMO.
I am also not sure who the "people" you refer to are, because, well, I
am among the people using PHP daily, and I would personally prefer a
more generic solution, which the Pipe Operator currently is.
Best wishes,
someniatko