$HTTP_GET_VARS vs. $_GET

liunx

Guest
Right so... The Dev team and I have just had a PHPconstruction meeting on how we should standardise our coding methods. All is well until we ran into a bit of a dibate regarding $HTTP_GET_VARS vs. $_GET.

I've done some reading and $_GET is a super global which is available in all functions and classes without using 'globla $_GET'.

What i want from this post is your views on the two ways to call the super vars/globals.

Regards,
Vince$_GET has been available since PHP4.1, and is recommended that new code use it. $HTTP_GET_VARS remains in order to support older code, and since PHP5.0.0 it has been possible to turn it off (and current versions have them turned off by default). On top of that, it may be removed from future versions entirely.

So what is the debate about?There is no debate. The long name versions will be gone in PHP 6.Ya move to $_GET/$_POSTThanks,

So it's out with that and in with the new. Crap, now I have to change all my code. LOL :(Ahh...not that hard.... /\$HTTP_(POST|GET|SESSION|COOKIE)_VARS\b/\$_$1/And with a bit more code that gets a list of all .php files in a directory recursively, you could make it all automatic :pTextPad, find - replace AND tick "all documents" :D
 
Back
Top