Member since
Not elegant
good
Still hard to read. No extra benefits.
The only clean solution is to use scalar types (string, int, float, boolean) and arrays like objects:
$result = "Hello World"->htmlentities()->split()->map(strtoupper(...))->filter(fn($v) => $v != 'O');
Chain, clean oop, readable, IDE hint, no value parameter, no prefixes and an opportunity to correct the functions inconsistency. It could works beside functions: strtoupper($name)
and $name->toUpper()
.
Interfaces should not have specific implementations, but define specifications.