Re: constant folding optimization

From: Date: Sat, 08 Sep 2007 18:20:06 +0000
Subject: Re: constant folding optimization
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-32120@lists.php.net to get a copy of this message
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. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com

« previous php.internals (#32120) next »