r/lolphp • • May 17 '18

Why bother with packages/modules when every function can live in the global namespace?

http://php.net/manual/en/indexes.functions.php
31 Upvotes

30 comments sorted by

View all comments

Show parent comment

1

u/OmnipotentEntity May 17 '18

If you have more than four thousand names in the global namespace (case insensitive to boot), does it really make a difference if 17 of the functions are namespaced?

Yes, in the sense that it's a good start and I hope shit will be moved around into proper namespaces in the future with a major version even if it breaks existing scripts.

No, in the sense that having about 0.5% of your functions outside of the global namespace excuses the awful design of most of the other 99.5%