note 110311 added to function.unset
| From: | espertalhao04 at hotmail dot com | Date: | Tue, 09 Oct 2012 22:36:22 +0000 |
| Subject: | note 110311 added to function.unset | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-191220@lists.php.net to get a copy of this message | ||
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!!!
----
Server IP: 69.147.83.199
Probable Submitter: 85.242.234.101
----
Manual Page -- http://www.php.net/manual/en/function.unset.php
Edit -- https://master.php.net/note/edit/110311
Del: integrated -- https://master.php.net/note/delete/110311/integrated
Del: useless -- https://master.php.net/note/delete/110311/useless
Del: bad code -- https://master.php.net/note/delete/110311/bad+code
Del: spam -- https://master.php.net/note/delete/110311/spam
Del: non-english -- https://master.php.net/note/delete/110311/non-english
Del: in docs -- https://master.php.net/note/delete/110311/in+docs
Del: other reasons-- https://master.php.net/note/delete/110311
Reject -- https://master.php.net/note/reject/110311
Search -- https://master.php.net/manage/user-notes.php