Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:35734 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2370 invoked by uid 1010); 22 Feb 2008 16:53:28 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 2355 invoked from network); 22 Feb 2008 16:53:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Feb 2008 16:53:28 -0000 Authentication-Results: pb1.pair.com smtp.mail=cschneid@cschneid.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=cschneid@cschneid.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain cschneid.com from 195.226.6.51 cause and error) X-PHP-List-Original-Sender: cschneid@cschneid.com X-Host-Fingerprint: 195.226.6.51 darkcity.gna.ch Linux 2.6 Received: from [195.226.6.51] ([195.226.6.51:49643] helo=mail.gna.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6A/0F-22931-40EFEB74 for ; Fri, 22 Feb 2008 11:53:25 -0500 Received: from localhost (localhost [127.0.0.1]) by darkcity.gna.ch (Postfix) with ESMTP id 1F2CA15E25D; Fri, 22 Feb 2008 17:53:22 +0100 (CET) Received: from unknown by localhost (amavisd-new, unix socket) id client-XXE6jht6; Fri, 22 Feb 2008 17:53:19 +0100 (CET) Received: from box.local (84-72-92-81.dclient.hispeed.ch [84.72.92.81]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by darkcity.gna.ch (Postfix) with ESMTP id 01ED015E24F; Fri, 22 Feb 2008 17:53:18 +0100 (CET) Message-ID: <47BEFDFE.909@cschneid.com> Date: Fri, 22 Feb 2008 17:53:18 +0100 User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Gregory Beaver CC: internals Mailing List References: <47BD207C.2080905@chiaraquartet.net> <47BD928E.8080006@cschneid.com> <47BE6413.6090507@chiaraquartet.net> In-Reply-To: <47BE6413.6090507@chiaraquartet.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at gna.ch Subject: Re: Trait aliasing syntax suggestions From: cschneid@cschneid.com (Christian Schneider) Gregory Beaver schrieb: > Christian Schneider wrote: >> Another detail: The implementation of the parser changes should still >> allow a class or function called "trait", i.e. "trait" should only be a >> keyword at specific positions in the source to avoid unneccesary BC >> breaks. The current patch has this BC problem. > > This is not possible to implement, having tried to do a similar thing > for 'import' and 'namespace.' The reason is that we can encounter a > classname at any point thanks to "classname::whatever" syntax, so it > slows the lexer down a bit in that for every T_TRAIT we would have to > check to see if the next 2 characters are ::, and makes the lexer > uber-complicated. It's a big mess. I think this is a point we should take seriously. I see the following solutions: 1. Wait with the introduction until either the parser allows such an addition without BC break or wait for the appropriate PHP release. (Is 5.3 the time to introduce this BC break? I don't know the current PHP definitions about major/minor releases) 2. Consider this issue carefully when deciding on a syntax. Maybe favour a syntax with fewer new keywords. Reusing keywords like "include", "as" or "not" come to mind. - Chris