On Mon, Jul 11, 2011 at 5:08 PM, Matthew Weier O'Phinney <weierophin...@php.net> wrote: > 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. >
the parser is a little bit dumb, and the namespaces isn't really first class citizens in php AFAIK, so it's not a deliberate restriction imo, just a technical, which could be solved. -- Ferenc Kovács @Tyr43l - http://tyrael.hu -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php