note 33997 added to function.get-defined-vars

From: Date: Sun, 13 Jul 2003 04:41:28 +0000
Subject: note 33997 added to function.get-defined-vars
Groups: php.notes 
Request: Send a blank email to php-notes+get-52016@lists.php.net to get a copy of this message
Wouldn't it be nice if there was an optional "LOCAL" argument for this fn so that you could get an (associative) array of the vars in the same scope as the get_defined_vars() call, but no others? This would be useful inside a user-defined function. Suppose you extract() some $result vars from a db query row, process some of them, add one or two new ones, and then you want to return the lot from the function: rather than having to explicitly define an array, you could just do: return get_defined_vars(LOCAL); ---- Manual Page -- http://www.php.net/manual/en/function.get-defined-vars.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33997 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33997&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33997&report=yes

« previous php.notes (#52016) next »