Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53874 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90858 invoked from network); 11 Jul 2011 15:08:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Jul 2011 15:08:44 -0000 X-Host-Fingerprint: 96.2.18.191 host-191-18-2-96.midco.net Date: Mon, 11 Jul 2011 11:08:43 -0400 Received: from [96.2.18.191] ([96.2.18.191:1804] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 25/72-09103-BF11B1E4 for ; Mon, 11 Jul 2011 11:08:43 -0400 Message-ID: <25.72.09103.BF11B1E4@pb1.pair.com> To: internals@lists.php.net References: <4E1A012F.3030703@sugarcrm.com> User-Agent: slrn/pre1.0.0-18 (Linux) X-Posted-By: 96.2.18.191 Subject: Re: Make primitive type names reserved words (Was: Re: [PHP-DEV] [RFC] 5.4 features for vote (long)) From: weierophinney@php.net (Matthew Weier O'Phinney) On 2011-07-10, Stas Malyshev 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