Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:11953 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13913 invoked by uid 1010); 6 Aug 2004 02:47:34 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 13887 invoked from network); 6 Aug 2004 02:47:34 -0000 Received: from unknown (HELO took.shire) (68.122.184.4) by pb1.pair.com with SMTP; 6 Aug 2004 02:47:34 -0000 Received: (qmail 69664 invoked by uid 1001); 6 Aug 2004 03:03:47 -0000 Date: Fri, 6 Aug 2004 03:03:47 +0000 To: internals@lists.php.net Message-ID: <20040806030347.GW6522@bagend.shire> Mail-Followup-To: internals@lists.php.net References: <20040804233723.9149.qmail@pb1.pair.com> <5.1.0.14.2.20040804165109.02e94c58@127.0.0.1> <20040805141732.72516.qmail@pb1.pair.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040805141732.72516.qmail@pb1.pair.com> User-Agent: Mutt/1.4.1i Subject: Re: [PHP-DEV] Variable Variables and Superglobals From: curt@php.net (Curt Zirzow) * Thus wrote A.Rico: > What the PHP documentation says about variable variables and > superglobals is that you can't use them as a "pointer": > > /*Warning*/ > > / Please note that variable variables cannot be used with PHP's > Superglobal arrays > . > This means you cannot do things like ${$_GET}. If you are looking > for a way to handle availability of superglobals and the old > HTTP_*_VARS, you might want to try referencing > them. / > > what I intended was to use a "normal" globally defined variable to > "point" to a superglobal; that, in fact, works in the global scope, but > not in the function scope: > > // Code ////////////////////////////////////////////////////////////// > $varvar="_ENV"; > > echo $_ENV["OS"]; // --> Windows NT > echo ${$varvar}; // --> Windows NT This is a documentation issue, i believe, as noted on: http://php.net/variables.predefined Variable variables super globals aren't allowed inside functions or methods. The waring on the page you reference is fixed in the docs reflecting this. Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid!