Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39514 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19387 invoked from network); 31 Jul 2008 17:08:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Jul 2008 17:08:33 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; 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:35868] helo=il-gw1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7D/31-60033-E81F1984 for ; Thu, 31 Jul 2008 13:08:32 -0400 Received: from ws.home ([10.1.1.1]) by il-gw1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 31 Jul 2008 20:09:08 +0300 Message-ID: <4891F189.7030202@zend.com> Date: Thu, 31 Jul 2008 21:08:25 +0400 User-Agent: Thunderbird 2.0.0.14 (X11/20080501) MIME-Version: 1.0 To: Matt Wilmas CC: internals@lists.php.net References: <00ea01c8a160$2edd8160$0201a8c0@pc1> <016c01c8eccd$e28cfac0$0201a8c0@pc1> <488835D0.1040005@zend.com> <00e501c8ed77$3498cf20$0201a8c0@pc1> <48889901.8000008@zend.com> <015101c8f306$34c358f0$0201a8c0@pc1> <4891CC46.2020208@zend.com> <020e01c8f32e$a82a9fb0$0201a8c0@pc1> In-Reply-To: <020e01c8f32e$a82a9fb0$0201a8c0@pc1> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 31 Jul 2008 17:09:09.0128 (UTC) FILETIME=[2562F080:01C8F330] Subject: Re: [PHP-DEV] [PATCH] No runtime fetching of built-in global constants From: dmitry@zend.com (Dmitry Stogov) Hi Matt, Now I know. :) Anyway, I don't think this optimization will work often. Send me the patch after Alpha1 release. Thanks. Dmitry. Matt Wilmas wrote: > Hi Dmitry, > > Do you know that with your changes, no substitution will happen in a > namespace even when using :: prefix? :-/ (That's what I would do when I > know it's global, for optimization.) Or is that what you meant by "not so > optimal?" > > > - Matt > > > ----- Original Message ----- > From: "Dmitry Stogov" > Sent: Thursday, July 31, 2008 > >> Thanks Matt. I committed near the same patch. >> It's not so optimal, but little bit more clear. >> >> Thanks. Dmitry. >> >> Matt Wilmas wrote: >>> Hi Dmitry, >>> >>> For the behavior change that I mentioned in the other thread, with this >>> code: >>> >>> function foo() { >>> static $a = -PHP_INT_MAX; >>> } >>> >>> Which could work sometimes, and sometimes not (if in a namespace or >>> ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION is set). I changed things so that >>> there is no substitution of constants (except with CT_SUBST flag, like >>> always) for compile time constants (ZEND_CT mode). They don't create a >>> FETCH_CONSTANT opcode anyway. :-) >>> >>> Another thing I realized wasn't getting optimized (runtime constants), > which >>> can be, is with: >>> >>> namespace foo; >>> $a = ::PHP_INT_MAX; // :: for global scope >>> >>> So the patch allows substitution there as well. >>> >>> http://realplain.com/php/ct_const_fixes.diff >>> http://realplain.com/php/ct_const_fixes_5_3.diff >