3 ms·
Show HN: Namespaced PHP functions to fix inconsistencies in the PHP language
- nkkollaw 9y ago(see: https://news.ycombinator.com/item?id=14883784 https://news.ycombinator.com/item?id=14883784)
- k__ 9y agoMaybe also normalise error handling? Some functions simply return null on an error and some throw.
- nkkollaw 9y agoThat's not a bad idea, but I wonder if deviating too much from PHP (besides naming) would create confusion. If you see..: htmlenties() versus: \PHP\html_entities() ...you assume \PHP\html_entities() works the same as `htmlenties()`
- conradk 9y agoWould it work to override [1] inconsistent functions with consistent versions? [1] http://php.net/manual/fr/function.override-function.php http://php.net/manual/fr/function.override-function.php
- nkkollaw 9y agoGood link but probably better to keep build-in functions alone, since many many libraries use them and expect them to be a certain way. \PHP\function_name() is fine IMHO.