note 44140 added to function.unset

From: Date: Thu, 15 Jul 2004 22:27:01 +0000
Subject: note 44140 added to function.unset
Groups: php.notes 
Request: Send a blank email to php-notes+get-73339@lists.php.net to get a copy of this message
I found that it's not possible to unset( $some_super_or_normally_globalized_variable). Kinda ruined my day, since I was removing all the superglobals into an artificial page environment object and filetering them en masse. And assigning NULL to them ISN'T deleting them. So what to do? Easy, I found out, (and I didn't see this in the online manual). Assign an unset variable to the superglobal. Example(replace all '.' with spaces if you want to try it: class myclass{ ....var $local_GET; ....function myclass(){ ........$unset_variable; ........$this->local_GET=$_GET; ........$_GET=$unset_variable; ....} } ---- Manual Page -- http://www.php.net/manual/en/function.unset.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+44140 Delete -- http://master.php.net/manage/user-notes.php?action=delete+44140&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+44140&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#73339) next »