On 2011-07-10, Stas Malyshev <smalys...@sugarcrm.com> wrote:
> On 7/10/11 9:41 AM, Patrick ALLAERT wrote:
> > Developer may have taken care of defining them in a specific
> > namespace, would it be possible to not break their application while
> > making them reserved keywords in the global namespace only?
>
> I don't think there's such thing in PHP as namespaced keywords. Keywords 
> are processed by the language parser, which knows next to nothing of 
> namespaces.
> We could, maybe, prohibit creation of classes with names identical to 
> type names, which is different from making it reserved word, and on that 
> stage we know the full class name.

I think that's a bad idea. The point of namespaces is to allow us to
override classes (and functions, and constants) within that namespace.
If I can't do this:

    namespace Foo
    {
        class String
        {
        }
    }

then I'd consider the implementation too restrictive.

-- 
Matthew Weier O'Phinney
Project Lead            | matt...@zend.com
Zend Framework          | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to