Re: Make primitive type names reserved words (Was: Re: [PHP-DEV] [RFC] 5.4 features for vote (long))
| From: | Matthew Weier O'Phinney | Date: | Mon, 11 Jul 2011 15:08:43 +0000 |
| Subject: | Re: Make primitive type names reserved words (Was: Re: [PHP-DEV] [RFC] 5.4 features for vote (long)) | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-53874@lists.php.net to get a copy of this message | ||
On 2011-07-10, Stas Malyshev <smalyshev@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 | matthew@zend.com
Zend Framework | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc