3 ms·
Why not just make types psuedo-objects? $myString.trim().replace("w", "h"); Which has the advantage of also offering a clean alternative to the fragmented std
by ChocolateGod 1y ago
Why not just make types psuedo-objects?
$myString.trim().replace("w", "h");
Which has the advantage of also offering a clean alternative to the fragmented stdlib.
- reddalo 1y agoI agree. But in PHP it would probably be like this: $myString->trim()->replace("w", "h");
- troupo 1y agoBecause pipes don't care about the type your function returns. And you don't need hundreds of methods on each type just in case. You just pipe the result of the previous function to the next one. And those functions can be business logic, or validation, or... Not just object methods
- williamdclt 1y ago> Why not just make types psuedo-objects? With this sort of "just" I could build Paris out of matchsticks
- account42 1y agoBecause duplicating the stdlib is probably not a good idea.