Hi Morgan,

> $sep|>explode(?, $str)
> or
> $str|>explode($sep, ?)

Right, PFA plus the pipe covers a lot of the chaining, and the ? placeholder for argument position is nice.

The difference I care about is what the chain binds to. $s |> trim(?) pipes into the global function namespace, so you get whatever trim / mb_trim / str_* happen to be, with their names and argument orders. $s->trim() is a small curated set defined on the type, so it autocompletes and the names stay stable. Different axes, they coexist fine. Pipe's the right tool for a lot of code. The methods just give primitives a small, discoverable surface for the common stuff.

Michal

Reply via email to