Use declaration outside of namespace
[email protected] ("Robert Stoll")
| Newsgroups | php.standards |
|---|---|
| Message-ID | <[email protected]> |
Heya, I always found it very ugly that it is possible to define a use outside of a namespace. Consider the following: use foo\Bar; namespace test; new Bar(); //error, test\Barnot found I do not see why we should actually support this behaviour in the specification of PHP. I do not see it as a bug in the current PHP implementation but I think we should consider to remove it in PHP 7. Although, it is not a bug, the use declaration is simply ignored as far as I can tell, but I suppose it confuses the user. Nevertheless, even if we declare it as a "feature" I think it should not be a "feature" of the specification. Thoughts? Cheers, Robert