Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP 6 Globals variables deprecated?

I've read stuff about global variables like $_SESSION, $_GET and $_POST being removed, or at least becoming deprecated in PHP 6.

Is this true? If so, what would be the alternative to retrieve data from the session or post?

Thanks!

like image 336
Kevin Avatar asked Feb 17 '26 18:02

Kevin


1 Answers

$_SESSION, $_GET, etc. are not globals. They are actually called superglobals and will NOT be deprecated in PHP 6.

I think you heard that register globals was going to be deprecated, which means array items in variable such as $_GET would be converted to variables like: $_GET['id'] to $id. Read more about register globals.