note 33997 deleted from function.get-defined-vars by sniper

From: Date: Sat, 23 Aug 2003 00:12:28 +0000
Subject: note 33997 deleted from function.get-defined-vars by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-54900@lists.php.net to get a copy of this message
Note Submitter: noel.darlow2@virgin.net ---- 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);

« previous php.notes (#54900) next »