Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53809 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 80247 invoked from network); 10 Jul 2011 21:17:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jul 2011 21:17:18 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.83.42 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 74.125.83.42 mail-gw0-f42.google.com Received: from [74.125.83.42] ([74.125.83.42:54496] helo=mail-gw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D7/32-63663-CD61A1E4 for ; Sun, 10 Jul 2011 17:17:17 -0400 Received: by gwb17 with SMTP id 17so1475459gwb.29 for ; Sun, 10 Jul 2011 14:17:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=loxqdk8mrQOR/FMDGxUAU4CQoOzdjUGrojZ7VU/16zY=; b=RYq/AEoYIlCOws4KOlA3GEtQePHPBTBU5W8uhjSd2rOT2VzPwMdARaxo31mPjLCmWC 0olgcTfIg8tZUMiBWVcAbzR1NzMVsVNlqOF/rSy+w/DiNjq8cpcYZdc7AIJLPuwOuDpM S/gcHOVw9FIvUdLGcYTPxmgH8DQdqAinOor7U= MIME-Version: 1.0 Received: by 10.236.0.201 with SMTP id 49mr4584675yhb.114.1310332633696; Sun, 10 Jul 2011 14:17:13 -0700 (PDT) Received: by 10.147.137.11 with HTTP; Sun, 10 Jul 2011 14:17:13 -0700 (PDT) In-Reply-To: References: Date: Sun, 10 Jul 2011 23:17:13 +0200 Message-ID: To: Patrick ALLAERT Cc: Stas Malyshev , PHP Internals Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Make primitive type names reserved words (Was: Re: [PHP-DEV] [RFC] 5.4 features for vote (long)) From: pierre.php@gmail.com (Pierre Joye) hi, As I could agree on this fact, I can't find any existing project having int(eger), float&co as class, namespaced or not. Do you have any example at hand? Cheers, On Sun, Jul 10, 2011 at 6:41 PM, Patrick ALLAERT w= rote: > 2011/6/17 Stas Malyshev : > > [snip] > >> 2. Make primitive type names reserved words (in case we ever want some f= orm >> 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 { > =A0 =A0class Int { > =A0 =A0 =A0 =A0// ... > =A0 =A0} > =A0 =A0class Float { > =A0 =A0 =A0 =A0// ... > =A0 =A0} > =A0 =A0class String { > =A0 =A0 =A0 =A0// ... > =A0 =A0} > =A0 =A0// ... > } > > 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 > > --=20 Pierre @pierrejoye | http://blog.thepimp.net | http://www.libgd.org