note 26502 added to function.unset

From: Date: Fri, 01 Nov 2002 19:39:53 +0000
Subject: note 26502 added to function.unset
Groups: php.notes 
Request: Send a blank email to php-notes+get-38884@lists.php.net to get a copy of this message
PHP3 to PHP4 unset issues. I was using unset freely in PHP3, to clear the contents of variables. and in PHP3, it didn't destroy the variable, it simply cleared its current contents. function foo(&$bar){ unset($bar); $bar = "new value"; } foo($bar) echo $bar; //IN PHP3 will print "new value" //IN PHP4 will print "" because the variable was never given a value. I took me forever to figure out why my functions weren't populating my variables... Learn from my mistake. -- http://www.php.net/manual/en/function.unset.php http://master.php.net/manage/user-notes.php?action=edit+26502 http://master.php.net/manage/user-notes.php?action=delete+26502 http://master.php.net/manage/user-notes.php?action=reject+26502

« previous php.notes (#38884) next »