note 110311 deleted from function.unset by mazzanet
| From: | mazzanet@php.net | Date: | Wed, 10 Oct 2012 01:03:32 +0000 |
| Subject: | note 110311 deleted from function.unset by mazzanet | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-191223@lists.php.net to get a copy of this message | ||
Note Submitter: espertalhao04 at hotmail dot com
----
i've accidently found a way to unset a variable past by reference over a function!
<?php
function clear(){}//the magic happens here!!!
function drop(&$v)
{
$v=clear();
}
$a=array(array("a","b","c"),array("a"));
drop($a);
echo var_dump($a);
echo var_dump(isset($a));
/*returns:
NULL
bool(false)
*/?>
for those who don't believe, try it!!!