Re: Deprecating "global" + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

From: Date: Thu, 09 Dec 2010 12:46:14 +0000
Subject: Re: Deprecating "global" + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-50946@lists.php.net to get a copy of this message
Adam Harvey wrote:
On 9 December 2010 18:14, Andrey Hristov <php@hristov.com> wrote:
the topic says most of it. What do you think about deprecating the global keyword and $GLOBALS with it? Together with this making $_REQUEST, $_GET and $_POST read-only as they should be used only to read-only anyway.
-1 here. No question that if you were developing a new language with similar design goals to PHP (but learning from the missteps), you'd probably make the superglobal analogues read only and skip the idea of $GLOBALS altogether, but there's just too much code out there that relies on these "features" working.
There were many apps which relied on register_globals but register_globals was introduced. There were many apps which relied on references in PHP4, but the object model changed in 5, references too. There are apps which rely on magic_quotes, but magic quotes are deprecated. When some feature is changed or deprecated there will always be applications that need to change.
Adam
Andrey

« previous php.internals (#50946) next »