Re: Re: superglobals and bc

From: Date: Sun, 13 Jan 2002 19:22:11 +0000
Subject: Re: Re: superglobals and bc
References: 1  Groups: php.dev php.doc 
Request: Send a blank email to php-dev+get-76896@lists.php.net to get a copy of this message
> > I mean, you could check php_version() and stick in some extract() calls
> > for older versions wherever you use the superglobals, but that seems
> > rather ugly.
> 
> Some really want it, let's define the most efficient/least ugly types of
> hacks :)  For example with get, checking phpversion,

I think it is better to check for the existense of these vars,
not the version!

> then appropriatly
> defining $_GET = &$HTTP_GET_VARS. And in a function, do: global $_GET.

Right :)

> Now mimicking $_SESSION functionality is another story, eww, maybe that's
> going too far.

This can be done by a register_shutdown_function() who registers
all the vars in $_SESSION, using session_register. That's all :))
If I can understand this new feature correctly (I never used it).

> Regarding the extract() idea, please clarify a little more.

I think Rasmus referred to the register_globals deprecation
question, which is another thing IMHO, that need to be documented.

There are many "user notes" coming up about using:

extract($_REQUEST);

and the like to simluate register_globals. This can
be a really bad thing sometimes...

Goba




Thread (13 messages)

« previous php.dev (#76896) next »