note 74609 deleted from function.unset by bjori

From: Date: Fri, 20 Apr 2007 09:18:43 +0000
Subject: note 74609 deleted from function.unset by bjori
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-125600@lists.php.net to get a copy of this message
Note Submitter: mark AT Ecrush tod com Reason: useless ---- well perhaps you cannot unset() a referenced variable like... <?php function foo(&$bar) { unset($bar); $bar = "blah"; } $bar = 'something'; echo "$bar\n"; foo($bar); echo "$bar\n"; ?> Output something something ...but you can like this... <?php function foo(&$bar) { unset($$bar); <- dereference the var $bar = "blah"; } $bar = 'something'; echo "$bar\n"; foo($bar); echo "$bar\n"; ?> Output something bar food for thought... - mark

« previous php.notes (#125600) next »