note 11821 added to language.references.unset.php
| From: | aulbach at unter dot franken dot de | Date: | Thu, 08 Mar 2001 17:23:12 +0000 |
| Subject: | note 11821 added to language.references.unset.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-12041@lists.php.net to get a copy of this message | ||
There are some other side effects:
<?
function test(&$bla) {
unset($bla);
$bla="huhu";
}
$bla="HIHI";
test($bla);
echo $bla;
?>
This will return "HIHI" - as (hopefuly) expected...
BUT (!)
<?
function test(&$bla) {
unset($bla['hugo']);
$bla['hugo']=3;
}
$bla=Array(
'hugo'=>1,
'huba'=>2
);
test($bla);
print_r($bla);
?>
Will return
Array ( [huba] => 2 [hugo] => 3 )
... which is in my eyes very strange.
I made a bug rebort (# 8972). Currently we discuss, if it is a bug or not. :-)
http://www.php.net/manual/en/language.references.unset.php