We are going to ignore the inherit problems that calling
file_get_contents(__FILE__); would cause...
Also, I disagree with a PHP namespace. the looseness of the language
is one of its strong points. Some things should be made strict, I
agree, bit it start with a php namespace and where does it end? If
your not careful you end up with c# or java where doing anything
requires going through hundreds of classes and packages.
Please let's avoid bad comparisons :P
We need to be very well aware that the concept of namespace in its simple,
clear, understandable form, represents:
1) no globals, everything in the namespace is in the namespace, including
vars, constants, functions, classes and nested namespaces.
2) to refer to a global namespace, there's no magical fallback to another
namespace (the global one), you need to "use" it specify it in your call
explicitly. The very idea of namespaces is, that other names don't leak into
your namespace.
3) we'll likely see in a future edition of PHP (5.4? 5.5? 6.0?) that many
currently global functions with "pseudo namespaces" like array_*(),
string_*() etc will gain concurrent aliases in a namespace: \array\*()
\string\*() since if we keep adding stuff in globals, then why introduce
namespaces at all?
4) any fallback, fudge, name leak, partial implementation represents
complication of the namespace concept, it's a compromise that makes
namespaces harder to implement, understand and use, but easier in the short
term for porting code and the "global functions all over the place" issue
PHP is so often criticised for.
So, while I remain flexible on the scale of the options, I really wish
people don't just think in the short term, since short term solutions are
what caused the necessity to use "\" instead of "::" in the first place.
When you're cornered by your ill past decisions, you either break BC (which
we don't want to do), or add more WTF-s to the language as it evolves.
Regards, Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php