Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53804 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66381 invoked from network); 10 Jul 2011 19:44:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jul 2011 19:44:51 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 67.192.241.123 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.123 smtp123.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.123] ([67.192.241.123:46269] helo=smtp123.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 16/50-63663-3310A1E4 for ; Sun, 10 Jul 2011 15:44:51 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp12.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id A03BF3C00A0; Sun, 10 Jul 2011 15:44:48 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp12.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 545773C009D; Sun, 10 Jul 2011 15:44:48 -0400 (EDT) Message-ID: <4E1A012F.3030703@sugarcrm.com> Date: Sun, 10 Jul 2011 12:44:47 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: Patrick ALLAERT CC: PHP Internals References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: Make primitive type names reserved words (Was: Re: [PHP-DEV] [RFC] 5.4 features for vote (long)) From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! On 7/10/11 9:41 AM, Patrick ALLAERT wrote: > I'm sure some projects have defined classes with those keywords in > some namespace (to ensure they wouldn't conflict with possible PHP > built-in stuff) like in: > > namespace \Types { > class Int { > // ... > } > class Float { > // ... > } > class String { > // ... > } > // ... > } We probably can do it so String is OK, but string is not. But yes, if we ever have scalar typing, it would conflict with such types I imagine. But this may be a problem for whoever would venture to create that patch, if it ever happens. > 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. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227