On Mon, 31 Jan 2005 19:27:31 +0100, Michael Virnstein
<[EMAIL PROTECTED]> 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/

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to