Re: Re: namespace separator ideas
| From: | Bart de Boer | Date: | Fri, 02 Dec 2005 09:21:12 +0000 |
| Subject: | Re: Re: namespace separator ideas | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-20995@lists.php.net to get a copy of this message | ||
Furthermore. The problem with echo 'a::b::c();' would only
occur if the code structure would be like this:
namespace a {
namespace b {
function c() { }
}
class b {
function c() { }
}
}
However, should it be legal to give a class the same name as
a namespace that's in the same scope? Maybe the code above
should simply fail with a message:
'Fatal error: Cannot redeclare class/namespace b'
This way we could use '::' :D
> BdB>>The above can either mean "call function c in namespace b under
> BdB>>namespace a" or "call static method c of class b under namespace a".
> BdB>>Since this cannot be determined, "::" cannot be used.
>
> This provided we support nested namespaces. Do we need them?
> --
> Stanislav Malyshev, Zend Products Engineer
> stas@zend.com http://www.zend.com/ +972-3-6139665 ext.115
>