Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I agree. But in PHP it would probably be like this:

$myString->trim()->replace("w", "h");



Because 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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: