Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:40139 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44289 invoked from network); 29 Aug 2008 15:19:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Aug 2008 15:19:28 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.163 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 212.25.124.163 il-gw1.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.163] ([212.25.124.163:62955] helo=il-gw1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 39/63-28247-E7318B84 for ; Fri, 29 Aug 2008 11:19:27 -0400 Received: from ws.home ([10.1.1.1]) by il-gw1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 29 Aug 2008 18:20:27 +0300 Message-ID: <48B8137A.4030906@zend.com> Date: Fri, 29 Aug 2008 19:19:22 +0400 User-Agent: Thunderbird 2.0.0.16 (X11/20080723) MIME-Version: 1.0 To: Matt Wilmas CC: internals@lists.php.net References: <013e01c8f257$1e1bbcf0$0201a8c0@pc1> <4890B18E.7000500@zend.com> <00e001c8f302$e8100fb0$0201a8c0@pc1> <4891A769.6090306@zend.com> <026201c909dc$46875860$0201a8c0@pc1> In-Reply-To: <026201c909dc$46875860$0201a8c0@pc1> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 29 Aug 2008 15:20:27.0940 (UTC) FILETIME=[C46F5E40:01C909EA] Subject: Re: [PHP-DEV] Re: [PATCH] Constant expr folding (again), and other things From: dmitry@zend.com (Dmitry Stogov) Hi Matt, Sorry, I just don't have time to look into it in last minute. Thanks. Dmitry. Matt Wilmas wrote: > Hi again Dmitry, > > ----- Original Message ----- > From: "Dmitry Stogov" > Sent: Thursday, July 31, 2008 > >> Hi Matt, >> >> For now I would like to disable "-CONST" constant expression which >> started to work after your patch. >> >> Later we are able to implement the complete constant expressions support. > > One more updated thing to ask about. :-) From the last reply, I wasn't sure > if constant folding in zend_do_[binary|unary]_op() could be added (for > negative numbers, ORing function flags that were substituted, ~0, 1024 * > 1024, etc.) or it was desired to wait for "complete constant expressions > support" (in static_scalar context), though I don't see any relation between > that, which is an actual language change, and this easy optimization that's > only internal (and more useful now with constant substitution). > > So I updated the patch, which is the same code as before, but without trying > to add partial expression support to static_scalar. Seems pretty > simple/safe, with basically just the if () { } block added in > zend_do_[binary|unary]_op(). :-) The rest updates the unary_op_type typedef > (was missing TSRMLS_DC), adds binary_op_type, and updates get_binary_op > (half the patch!). The couple changes in the parser, which CAN be ignored > if desired, are mostly a cleanup, but '+' static_scalar now actually "does > something" like the unary + operator in regular contexts. As I showed > before, it makes the following consistent: > > function foo() { > static $a = -'abc'; // 0 > static $b = +'abc'; // abc > $c = +'abc'; // 0 > } > > http://realplain.com/php/const_folding.diff > http://realplain.com/php/const_folding_5_3.diff > > Well, I don't know if it can be tossed in quickly at this time, but there ya > go since I think it's pretty basic! ;^) > >> Thanks. Dmitry. > > Thanks, > Matt > >