note 47914 added to language.variables.scope

From: Date: Sun, 05 Dec 2004 10:08:17 +0000
Subject: note 47914 added to language.variables.scope
Groups: php.notes 
Request: Send a blank email to php-notes+get-81387@lists.php.net to get a copy of this message
The last code I posted only copied the variables into the local function, by replacing the foreach block in that code with the following one, a reference is created so the variable can be modified inside the function and retain its value outside of the function. <?php foreach ($GLOBALS as $key=>$value) { $$key = & $GLOBALS[$key]; } ?> ---- Manual Page -- http://www.php.net/manual/en/language.variables.scope.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+47914 Delete -- http://master.php.net/manage/user-notes.php?action=delete+47914&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47914&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47914&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47914&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47914&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47914&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+47914&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#81387) next »