Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54240 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 41746 invoked from network); 28 Jul 2011 23:54:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Jul 2011 23:54:19 -0000 Authentication-Results: pb1.pair.com header.from=johannes@schlueters.de; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=johannes@schlueters.de; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain schlueters.de from 217.114.211.66 cause and error) X-PHP-List-Original-Sender: johannes@schlueters.de X-Host-Fingerprint: 217.114.211.66 config.schlueters.de Received: from [217.114.211.66] ([217.114.211.66:40699] helo=config.schlueters.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0A/00-35879-8A6F13E4 for ; Thu, 28 Jul 2011 19:54:18 -0400 Received: from [67.23.203.99] (unknown [67.23.203.99]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by config.schlueters.de (Postfix) with ESMTPSA id 513C577A77; Fri, 29 Jul 2011 01:54:13 +0200 (CEST) To: Kiyoto Tamura Cc: internals@lists.php.net In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Date: Thu, 28 Jul 2011 16:53:30 -0700 Message-ID: <1311897211.15749.0.camel@guybrush> Mime-Version: 1.0 X-Mailer: Evolution 2.30.2 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] parsing break and continue statements From: johannes@schlueters.de (Johannes =?ISO-8859-1?Q?Schl=FCter?=) On Thu, 2011-07-28 at 16:10 -0700, Kiyoto Tamura wrote: > Hi, > > I am new to the PHP internals, and I was just looking through the code > related to parsing break/continue statements. It looks that as of PHP > 5.4, Zend/zend_language_parser.y accepts both "T_BREAK expr" and > "T_CONTINUE expr" and check to make sure "expr" is a positive integer > in the function zend_do_brk_cont. Doesn't it make more sense to > replace "T_BREAK expr" with "T_BREAK " (the same > goes for the continue statement)? T_BREAK expr allows things like $foo = rand(...); break $foo; but we've dropped that for performance reasons in 5.4. johannes > Thanks in advance! > > kiyoto >