3 ms·
I don't get your issue with builtin utilities. The design philosophy of PHP is to include whatever common methods would otherwise be in a popular library. (PHP
by sam_goody 2y ago
I don't get your issue with builtin utilities.
The design philosophy of PHP is to include whatever common methods would otherwise be in a popular library. (PHP actually began more as a library than as a language.) This differs from, eg, Python, but doesn't hurt.
The decision not not to make methods on the objects, but to include everything in the main namespace (so array_walk instead of Array.walk or Array()->walk etc) is another function of the same philosophy. It may not fit your idea of cosmetics, but there is nothing wrong with it.
On the other hand, I would love if PhP gained chainability ([].array_map.array_find()) and then the names would be a pain. If that ever happens there are solutions.
- askonomm 2y agoThere is a RFC on it (https://wiki.php.net/rfc/function-composition https://wiki.php.net/rfc/function-composition) which I'd love if it made it through. Until then Crell's FP library is a good option (https://github.com/Crell/fp https://github.com/Crell/fp).