
Show HN: Namespaced PHP functions to fix inconsistencies in the PHP language - nkkollaw
https://github.com/nkkollaw/php
======
conradk
Would 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
Good 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.

------
nkkollaw
(see:
[https://news.ycombinator.com/item?id=14883784](https://news.ycombinator.com/item?id=14883784))

~~~
k__
Maybe also normalise error handling?

Some functions simply return null on an error and some throw.

~~~
nkkollaw
That'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()`

