> -----Original Message-----
> From: Paul Nicholson [mailto:[EMAIL PROTECTED]]
> Sent: 02 October 2002 02:11
> Hey gang,
> 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).

I think this is going the wrong way about it -- the $HTTP_*_VARS arrays may be 
deprecated, but the PHP developers have confirmed that they are not going to disappear 
any time soon, so for code that has to work regardless of register_globals setting and 
existence or not of superglobals, I'd stick with those.

(And, as already pointed out, the $_* arrays you create in this way are *not* 
superglobals, and so would need to be globalled in every function which references 
them, just like the $HTTP_*_VARS arrays -- so the only saving is maybe a few 
characters less to type, but with the addition of much potential for confusion.)



Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to