Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53798 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42496 invoked from network); 10 Jul 2011 16:57:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jul 2011 16:57:43 -0000 Authentication-Results: pb1.pair.com header.from=moshe@kemmart.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=moshe@kemmart.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain kemmart.com from 209.85.161.46 cause and error) X-PHP-List-Original-Sender: moshe@kemmart.com X-Host-Fingerprint: 209.85.161.46 mail-fx0-f46.google.com Received: from [209.85.161.46] ([209.85.161.46:44265] helo=mail-fx0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EB/60-38647-50AD91E4 for ; Sun, 10 Jul 2011 12:57:41 -0400 Received: by fxh19 with SMTP id 19so3364133fxh.19 for ; Sun, 10 Jul 2011 09:57:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.85.155 with SMTP id o27mr2384984fal.109.1310317058270; Sun, 10 Jul 2011 09:57:38 -0700 (PDT) Sender: moshe@kemmart.com Received: by 10.223.78.144 with HTTP; Sun, 10 Jul 2011 09:57:38 -0700 (PDT) X-Originating-IP: [70.246.224.209] In-Reply-To: References: Date: Sun, 10 Jul 2011 11:57:38 -0500 X-Google-Sender-Auth: aWDhE26pxC7c1zQK0zV_CybWeBA Message-ID: To: PHP Internals Content-Type: multipart/alternative; boundary=001517448134cd26f904a7b9f6a1 Subject: Re: [PHP-DEV] Make primitive type names reserved words (Was: Re: [PHP-DEV] [RFC] 5.4 features for vote (long)) From: moshe@sammymoshe.com (Sammy Moshe) --001517448134cd26f904a7b9f6a1 Content-Type: text/plain; charset=ISO-8859-1 There's going to be a ton of code in the wild that will break if primitive types become reserved words. On Sun, Jul 10, 2011 at 11:41 AM, Patrick ALLAERT wrote: > 2011/6/17 Stas Malyshev : > > [snip] > > > 2. Make primitive type names reserved words (in case we ever want some > form > > of scalar typing or anything else with scalar types). Using them as > > identifiers would return parse error for now. May have BC implications. > > I am not sure it is a good idea to make them reserved words without a > clear reason for doing so. > > 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 { > // ... > } > // ... > } > > 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 would be +1 if this could be done for the global namespace only. > However, -1 if this would break the usage of classes like \Types\Int, > \Types\String, ... would break. > > Please, rethink your vote taking this into account. I don't think it > is required to hurry up on that decision while we still don't have a > *clear* proposition for scalar type hinting. > > Cheers, > Patrick > > [snip] > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --001517448134cd26f904a7b9f6a1--