RE: [PHP] backwards compat for newly developed scripts ($_GET / $HTTP_GET_VARS)
| From: | John W. Holmes | Date: | Wed, 02 Oct 2002 03:45:09 +0000 |
| Subject: | RE: [PHP] backwards compat for newly developed scripts ($_GET / $HTTP_GET_VARS) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-118541@lists.php.net to get a copy of this message | ||
> I've been wondering about developing scripts that the end-user might
run
> on
> php < 4.1.0. I've heard allot of ways except for one that I recently
> thought
> of.
> How about using:
> - ----
> if(!isset($_GET)) { global $HTTP_GET_VARS; $_GET = &$HTTP_GET_VARS; }
> - ----
> ? That allows you to use $_GET as if you were using the new versions
and
> it
> only requires one line....and doesn't depend on the new versions to
have
> $HTTP_*_VARS. It also works for the other vars(POST, SESSION, etc).
Except the $_GET that you would create with older version would not be
superglobal. You would have to make it global in each function if it's
used within it.
---John Holmes...