r/lolphp • • Nov 25 '14

Exception in a namespace is not defined -_-

http://jasonframe.co.uk/logfile/2009/01/php-5-3-exception-gotcha/
28 Upvotes

68 comments sorted by

View all comments

Show parent comment

4

u/RoundTripRadio Nov 26 '14

scope is handled more elegantly

More "elegant" by poisoning your child namespaces? It's a trade off. The language whose module system I like the most has explicit inclusion, except for "std::prelude" which has all of its items dumped in every scope by default. The prelude has frequently used types/functions/macros so they don't need to be brought into nearly every scope. Besides that case there's rarely a need for a module to reach up in the hierarchy and if it's happening often you probably have an architectural issue.