Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53801 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52178 invoked from network); 10 Jul 2011 17:41:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jul 2011 17:41:15 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@googlemail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@googlemail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.215.170 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@googlemail.com X-Host-Fingerprint: 209.85.215.170 mail-ey0-f170.google.com Received: from [209.85.215.170] ([209.85.215.170:37943] helo=mail-ey0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 47/12-38647-A34E91E4 for ; Sun, 10 Jul 2011 13:41:14 -0400 Received: by eyf5 with SMTP id 5so1082548eyf.29 for ; Sun, 10 Jul 2011 10:41:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=4i1wYSOslxawdHESLwVAT3iF6ub9wnimDR/81NXhiXg=; b=WdyXq4zur01YoaCCfxCd3iHLxxafdJfkBd/3+0WPOxrQpjiQNG0gpA1licShzNQTH1 CCsJbB4lsZ1LwqElwRNBBKYcIdhfQDDBxTPvDgEHyvLkq8ljk/biI75L6cpXvxjmRyMC 26jTAG1QsN3xbNL+3WjkmhRqVrNqQFftFxx10= MIME-Version: 1.0 Received: by 10.14.50.129 with SMTP id z1mr1184118eeb.54.1310319670886; Sun, 10 Jul 2011 10:41:10 -0700 (PDT) Received: by 10.14.99.131 with HTTP; Sun, 10 Jul 2011 10:41:10 -0700 (PDT) In-Reply-To: References: Date: Sun, 10 Jul 2011 19:41:10 +0200 Message-ID: To: Patrick ALLAERT Cc: Stas Malyshev , PHP Internals Content-Type: multipart/alternative; boundary=0023543a27ee86808204a7ba9285 Subject: Re: [PHP-DEV] Make primitive type names reserved words (Was: Re: [PHP-DEV] [RFC] 5.4 features for vote (long)) From: nikita.ppv@googlemail.com (Nikita Popov) --0023543a27ee86808204a7ba9285 Content-Type: text/plain; charset=ISO-8859-1 Well, I generally think that PHP should be less strict about reserved keywords. The number of reserved keywords increases with every further release of PHP. For example PHP 5.4 introduces "trait" and "insteadof". PHP 5.3 introduced even more. Every new keyword PHP introduces both breaks old code and reduces the naming possibilities for classes and methods. I don't think that it's possible to refrain from adding further keywords. The language grows and with it the list of keywords. But I do think that it should be possible to prevent these additions from breaking old code or restricting userland naming. E.g. Writing class Evaluator { public function eval() { } } Does in no way create an ambiguity with the eval language construct PHP implements. But still PHP doesn't allow writing the above code. It would make sense to allow the use of the keyword in such situations. Actually PHP already does this in one place: The token after T_OPJECT_OPERATOR is never interpreted as a keyword. I.e. one can write $this->eval() (and define a magic __call method for 'eval'). I don't know whether this is actually possible, but I've at least already seen a patch (http://pear.php.net/~greg/smarter_lexer.patch.txt) for the methodname case linked from a feature request (https://bugs.php.net/bug.php?id=28261). MfG Nikita --0023543a27ee86808204a7ba9285--