简体   繁体   中英

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!

$_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 .

No, you've read a rumor. A wrong one.

There isn't really that much known about PHP 6, so speculating about it doesn't make much sense.

Maybe you are referring to the removal of register_globals , session_register() and session_unregister() . Which were already deprecated in PHP 5.3.

These functions are deprecated with good reason, and you really shouldn't rely on them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM