Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:14632 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56637 invoked by uid 1010); 4 Feb 2005 02:07:01 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 56542 invoked from network); 4 Feb 2005 02:06:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Feb 2005 02:06:59 -0000 X-Host-Fingerprint: 80.74.107.235 mail.zend.com Linux 2.4/2.6 Received: from ([80.74.107.235:37896] helo=mail.zend.com) by pb1.pair.com (ecelerity HEAD (r4105:4106)) with SMTP id EA/17-05104-2C8D2024 for ; Thu, 03 Feb 2005 21:06:59 -0500 Received: (qmail 11793 invoked from network); 4 Feb 2005 02:06:51 -0000 Received: from localhost (HELO andi-notebook.zend.com) (127.0.0.1) by localhost with SMTP; 4 Feb 2005 02:06:51 -0000 Message-ID: <5.1.0.14.2.20050203180548.026cf790@localhost> X-Sender: andi@localhost X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Thu, 03 Feb 2005 18:06:48 -0800 To: Michael Virnstein ,internals@lists.php.net In-Reply-To: <20050203221208.67112.qmail@lists.php.net> References: <20050131222442.61678.qmail@lists.php.net> <20050128223155.81436.qmail@lists.php.net> <5.1.0.14.2.20050128145327.04025190@localhost> <20050128233054.9657.qmail@lists.php.net> <20050128234649.27693.qmail@lists.php.net> <20050128235345.42569.qmail@lists.php.net> <20050130193103.63809.qmail@lists.php.net> <20050131182732.84357.qmail@lists.php.net> <20050131211614.84286.qmail@lists.php.net> <20050131222442.61678.qmail@lists.php.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: Re: [PHP-DEV] Re: referencing Superglobals with variable variables inside functions From: andi@zend.com (Andi Gutmans) Superglobals are compiled into global fetches. However, we didn't want to and don't want to slow down the average fetch by checking if it's a superglobal first (i.e. variable variable). This also includes $this which is evaluted at compile-time. I think this is quite fair. Andi At 11:12 PM 2/3/2005 +0100, Michael Virnstein wrote: >Sara Golemon wrote: > > Index: Zend/zend_execute.c > > =================================================================== > > RCS file: /repository/ZendEngine2/zend_execute.c,v > > retrieving revision 1.692 > > diff -u -r1.692 zend_execute.c > > --- Zend/zend_execute.c 22 Jan 2005 02:29:18 -0000 1.692 > > +++ Zend/zend_execute.c 31 Jan 2005 22:13:50 -0000 > > @@ -1001,6 +1001,10 @@ > > { > > switch (opline->op2.u.EA.type) { > > case ZEND_FETCH_LOCAL: > > + if (zend_hash_exists(CG(auto_globals), > > variable->value.str.val, variable->value.str.len + 1)) { > > + /* Dynamically resolved auto global */ > > + return &EG(symbol_table); > > + } > > return EG(active_symbol_table); > > break; > > case ZEND_FETCH_GLOBAL: > >i must admit, that i don't know very much about the zend engine and the >php core in general, but if "opline->op2.u.EA.type" "knows" if the >variable is a local one, a global one or a static one, why hasn't it the >value of ZEND_FETCH_GLOBAL for superglobals in the first place? > >Michael > >-- >PHP Internals - PHP Runtime Development Mailing List >To unsubscribe, visit: http://www.php.net/unsub.php