# [Pre-RFC] Scalar object methods (with a working implementation)

- Thread: https://externals.io/message/131770
- Original archive: https://news-web.php.net/php.internals/131770
- Started by Michal Kral on 2026-07-04T20:35:07+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #131770 — Michal Kral — 2026-07-04T20:35:07+00:00

URL: https://externals.io/message/131770#131770

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
