Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32428 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 71660 invoked by uid 1010); 23 Sep 2007 19:28:21 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 71645 invoked from network); 23 Sep 2007 19:28:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Sep 2007 19:28:21 -0000 Authentication-Results: pb1.pair.com smtp.mail=paul.biggar@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=paul.biggar@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.146.176 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: paul.biggar@gmail.com X-Host-Fingerprint: 209.85.146.176 wa-out-1112.google.com Received: from [209.85.146.176] ([209.85.146.176:50295] helo=wa-out-1112.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CF/5A-30687-45EB6F64 for ; Sun, 23 Sep 2007 15:28:21 -0400 Received: by wa-out-1112.google.com with SMTP id l24so1880016waf for ; Sun, 23 Sep 2007 12:28:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=7YtTJ/2+J2nWXXi1gF8/VhrOrp/OX56ps0S9/czKj3U=; b=NgYCuSLlTo8gq19a1oTLK/5jFwl/YxYzvwyd7DaYdbg0JWoYQYF7mcMbF9ZM/LnJmGC1c7LF7ZQ5BGgGS8uhz4VWi4zghuR2VSpVxUTNA0hwcr3j5ykdahqkt8piks0PaZCaUeEYxkbadtuGWmDER20y60Ga+PE9fHNA2FC0TvQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=WfwN46uZbM86FaSu7o3gYrPbwXLEWk562c2FyPC9bhCQsXgZlrwD08NGcf9GTZ1Xz0ANuEVfrTG8cMncqqWEsy4biWCA3jS5FAZowfLfRQeK3IYt0XTQOVWqur9KqMe4vHN+3bmCpXulfPXqMNOExPqeQYAzEnOPr9hpK08PbO0= Received: by 10.114.200.2 with SMTP id x2mr5993855waf.1190575694295; Sun, 23 Sep 2007 12:28:14 -0700 (PDT) Received: by 10.114.130.7 with HTTP; Sun, 23 Sep 2007 12:28:14 -0700 (PDT) Message-ID: Date: Sun, 23 Sep 2007 20:28:14 +0100 To: "Stanislav Malyshev" Cc: internals@lists.php.net In-Reply-To: <46F6B7BE.4020205@zend.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <46F6B7BE.4020205@zend.com> Subject: Re: [PHP-DEV] Compiled variables and backpatching From: paul.biggar@gmail.com ("Paul Biggar") On 9/23/07, Stanislav Malyshev wrote: > > What is a compiled variable? > > How does it differ from a non-compiled-variable? > > When engine encounters variable like $a what it usually does is it looks > up current symbol table for an entry named 'a', and then takes zval* > sitting there. However, since during the same scope the entry for $a > will be the same (though not a value sitting there!), once found in can > be stored so future calls to $a will not require looking up in the hash > table. That's what CVs do. The reason, of course, is performance :) 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? 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? Thanks for the quick response, Paul -- Paul Biggar paul.biggar@gmail.com