Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32460 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46882 invoked by uid 1010); 27 Sep 2007 00:50:04 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 46867 invoked from network); 27 Sep 2007 00:50:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Sep 2007 00:50:04 -0000 Authentication-Results: pb1.pair.com header.from=stas@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.162 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 212.25.124.162 mail.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.162] ([212.25.124.162:35038] helo=mx1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4A/38-33278-83EFAF64 for ; Wed, 26 Sep 2007 20:50:04 -0400 Received: from us-ex1.zend.com ([192.168.16.5]) by mx1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 27 Sep 2007 02:53:45 +0200 Received: from [127.0.0.1] ([192.168.16.180]) by us-ex1.zend.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 26 Sep 2007 17:53:40 -0700 Message-ID: <46FAFE2E.7090709@zend.com> Date: Wed, 26 Sep 2007 17:49:50 -0700 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: Paul Biggar CC: internals@lists.php.net References: <46F6B7BE.4020205@zend.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 27 Sep 2007 00:53:40.0182 (UTC) FILETIME=[D82F8760:01C800A0] Subject: Re: [PHP-DEV] Compiled variables and backpatching From: stas@zend.com (Stanislav Malyshev) > OK, so its a bit of caching. So it sounds like it stores a pointer > into the symbol table, so that if $a is redefined it will still be > correct. What happens if the symbol table must be rehashed? Does it > still work, or does it look it up again? I think rehashing doesn't matter since hash table has pointers, not actual zvals, and so does CV - so rehashing just moved pointers around, and actual zvals still reside in the same place. > Is there a single CV for each $a in a scope, or is there one per > bytecode operand? In other words, in a function which uses $a a lot, > does it look it up for each bytecode which uses $a, or only once for > that function? Each name has own CV, so that every time you say $a in same op-array it would be same CV. CVs are local per op-array - $a in two different op-arrays are different CVs, and local per function run - i.e. if the same function is run twice, $a has the same CV but values in this CV would be different, so you need one lookup each run. So if the function uses $a a lot, CVs would save all lookups except the very first one in each function run. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com