Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:14459 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30057 invoked by uid 1010); 31 Jan 2005 18:46:41 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 29930 invoked from network); 31 Jan 2005 18:46:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Jan 2005 18:46:39 -0000 X-Host-Fingerprint: 64.233.184.197 wproxy.gmail.com Linux 2.4/2.6 Received: from ([64.233.184.197:42350] helo=wproxy.gmail.com) by pb1.pair.com (ecelerity HEAD (r4105:4106)) with SMTP id 3E/8A-45719-D0D7EF14 for ; Mon, 31 Jan 2005 13:46:38 -0500 Received: by wproxy.gmail.com with SMTP id 57so669412wri for ; Mon, 31 Jan 2005 10:46:31 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=auPF2vZ/eCGGZ6DXMaDWCVS/52CtVo5OtKXatJNNO6r2/2XFNfx+NwVrFBba1C6dTYsto2+rVxsgZOnRjfCk6FcFvGq+Exry5O1xapwVtm+kni30ZbrWzdFe2sAQfFuFtYHYxAkaFbFsnUwBZAwVmHZqQUNuVDqbYHf3A3ZAmaw= Received: by 10.54.31.8 with SMTP id e8mr111032wre; Mon, 31 Jan 2005 10:39:51 -0800 (PST) Received: by 10.54.32.61 with HTTP; Mon, 31 Jan 2005 10:39:51 -0800 (PST) Message-ID: <5c287472050131103978a072b1@mail.gmail.com> Date: Mon, 31 Jan 2005 12:39:51 -0600 Reply-To: Jason Sweat To: Michael Virnstein Cc: internals@lists.php.net In-Reply-To: <20050131182732.84357.qmail@lists.php.net> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <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> Subject: Re: [PHP-DEV] referencing Superglobals with variable variables inside functions From: jason.sweat@gmail.com (Jason Sweat) On Mon, 31 Jan 2005 19:27:31 +0100, Michael Virnstein wrote: > Atm it isn't possible to use a construct like $var = ${'_GET'}; inside a > function or method. Will this behaviour change in future versions of > PHP? I think it is somehow odd and inconsistent to not be able to use > the superglobals that way, while it is possible outside of functions and > methods and also with any other variable, e.g. the $HTTP_*_VARS. > Imo it's an unnecessary restriction and will keep ppl using the old > $HTTP_*_VARS. I also see no reason for it to stay that way and i think > it wasn't intended by you, the developers, in the first place but turned > out to work that way afterwards. > So I really hope it'll change, would make much more sense. What do you > think? Try $_GET['foo'] = 'bar'; function x($val, $sg) { return $GLOBALS[$sg][$val]; } echo x('foo','_GET'); Regards, Jason http://blog.casey-sweat.us/