Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32121 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7422 invoked by uid 1010); 8 Sep 2007 18:50:08 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 7406 invoked from network); 8 Sep 2007 18:50:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Sep 2007 18:50:08 -0000 Authentication-Results: pb1.pair.com header.from=nlopess@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=nlopess@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 212.55.154.24 as permitted sender) X-PHP-List-Original-Sender: nlopess@php.net X-Host-Fingerprint: 212.55.154.24 relay4.ptmail.sapo.pt Linux 2.4/2.6 Received: from [212.55.154.24] ([212.55.154.24:45079] helo=sapo.pt) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 52/51-07479-FDEE2E64 for ; Sat, 08 Sep 2007 14:50:08 -0400 Received: (qmail 31187 invoked from network); 8 Sep 2007 18:50:03 -0000 Received: from unknown (HELO http13) (10.134.35.198) by relay4 with SMTP; 8 Sep 2007 18:50:03 -0000 Received: (qmail 1829 invoked by uid 64140); 8 Sep 2007 18:50:03 -0000 Received: from bl7-48-253.dsl.telepac.pt (bl7-48-253.dsl.telepac.pt [85.240.48.253]) by w13.mail.sapo.pt (Horde MIME library) with HTTP; Sat, 08 Sep 2007 19:50:02 +0100 Message-ID: <20070908195002.i184g0pk0k48gcg8@w13.mail.sapo.pt> Date: Sat, 08 Sep 2007 19:50:02 +0100 To: Stanislav Malyshev Cc: internals@lists.php.net, andi@php.net, dmitry@php.net References: <20070908121843.21wh7zk5k0g8s8cg@w13.mail.sapo.pt> <46E2E7D6.6090906@zend.com> In-Reply-To: <46E2E7D6.6090906@zend.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.2-cvs) X-Originating-IP: 85.240.48.253 X-PTMail-Version: 3.1.5 Subject: Re: Re: [PHP-DEV] constant folding optimization From: nlopess@php.net (Nuno Lopes) >> I made a patch to implement constant folding optimization in the >> Zend engine. >> The patch is available at: >> http://web.ist.utl.pt/nuno.lopes/zend_constant_folding.txt > > I like the idea a lot, however I think this patch has one > significant downside - as far as I understand, it doesn't enable > constant expressions in constant contexts. I.e. I can do $a = 2+2 > and get it evaluated but I can't do function foo($a = 2+2) or const > $a = 2+2. If we moved this to the parser level I think we could do > both. Well we don't support that syntax at this moment. If you are saying that we could add support for such syntax.. it does seem a good idea, but in that case we would need to modify a few rules of the grammar (like adding a const_expr production, and allow static_scalar derive it, etc..). If others agree with this syntax, I can take a look in implementing it. Nuno