note 24244 added to ref.variables

From: Date: Sat, 10 Aug 2002 13:32:17 +0000
Subject: note 24244 added to ref.variables
Groups: php.notes 
Request: Send a blank email to php-notes+get-34669@lists.php.net to get a copy of this message
I think the variables this workaround produces don't behave exactly like the variables defined by php >= 4.1.0 Maxim Maletsky wrote: -------------------------------------- function test() { echo $_GET['some']; // will also work because a fake $_GET is GLOBAL } -------------------------------------- This WON'T work (at least it doesn't do for me) because fake $_GET is only in the global scope. You have to use function test() { global $_GET; echo $_GET['some']; } When using the real $_GET you don't have to do it, because the real one is SUPERGLOBAL (which means "available in every scope") lates, Cano2 -- http://www.php.net/manual/en/ref.variables.php http://master.php.net/manage/user-notes.php?action=edit+24244 http://master.php.net/manage/user-notes.php?action=delete+24244 http://master.php.net/manage/user-notes.php?action=reject+24244

« previous php.notes (#34669) next »