Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:41729 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76233 invoked from network); 6 Nov 2008 16:36:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Nov 2008 16:36:23 -0000 Authentication-Results: pb1.pair.com header.from=sv_forums@fmethod.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=sv_forums@fmethod.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fmethod.com from 69.16.228.148 cause and error) X-PHP-List-Original-Sender: sv_forums@fmethod.com X-Host-Fingerprint: 69.16.228.148 unknown Linux 2.4/2.6 Received: from [69.16.228.148] ([69.16.228.148:45794] helo=host.fmethod.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DB/E6-44653-60D13194 for ; Thu, 06 Nov 2008 11:36:23 -0500 Received: from [83.228.56.37] (port=4160 helo=pc) by host.fmethod.com with esmtpa (Exim 4.69) (envelope-from ) id 1Ky7qF-0003os-L2 for internals@lists.php.net; Thu, 06 Nov 2008 10:36:20 -0600 Message-ID: <909426E5B8F84EA990BFAE7770F9CBD5@pc> To: References: <4EA88C3A8A2747989925A5D21448FCE7@pc> <200811052154.29537.larry@garfieldtech.com> <98b8086f0811060150p2fb0312dj66896cb227c871ec@mail.gmail.com> <007301c93ffe$f4b5ad80$3ffc1f3e@foxbox> <029101c94004$d4564440$7d02ccc0$@com> <013b01c94007$b66d60a0$3ffc1f3e@foxbox> <491315D1.7050509@invisihosting.com> Date: Thu, 6 Nov 2008 18:36:12 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="ISO-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host.fmethod.com X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - fmethod.com Subject: Re: [PHP-DEV] Call it: allow reserved words in a class or not? From: sv_forums@fmethod.com ("Stan Vassilev | FM") Hi, Watching my thread devolve into a blamefest wasn't the intention. I just wanted a clear answer if something's done about it or not. To everyone participating in the thread: guys it's NOT trivial in the current situation. To the parser, a separate string matching a keyword is the token keyword. Reverting this or making it context sensitive is not trivial by any means. Still though: it IS possible, you'll find plenty of examples of context-specific keywords in other languages (including C# which was quoted here). Oh and btw, greg, in your example: you should print "1". There's one trivial solution: make the keywords and class names case-sensitive. Then classes "If", "Array", "Interface" will never class with the all-lowercase keywords. I have to say, we sorely do need consistency on that front as well, and since vars are already case sensitive, making it all case sensitive is one way to go forward. Why is this a problem at all? Well as people said, in .NET words like "array" are not a reserrved word. Even more, if I have Foo.Utils.FooUtils, that's some redundancy I can easily avoid in .NET by "using Foo.Utils.*". In PHP, we can't do star-imports since the parser doesn't know what's there to import at runtime. So we can't easily avoid the redundancy, unless we manually import the classes we want to use, one by one. So that's one more hassle which make redundant names a pain. Regards, Stan Vassilev