プログラム言語

6c291f80 :Anonymous 2011-03-10 14:27
>>82e0b2fa

が、連想配列のクローンはその方法では出来なかった。

PS H:\> function test($o){return $o}
PS H:\> $a=@{}
PS H:\> $a["hello"] = "world"
PS H:\> $a

Name Value
---- -----
hello world


PS D:\path> $b=test($a)
PS D:\path> $b

Name Value
---- -----
hello world


PS D:\path> $a["hi"] = "universe"
PS D:\path> $a

Name Value
---- -----
hi universe
hello world


PS D:\path> $b

Name Value
---- -----
hi universe
hello world


どういう仕様なのだろうか?
Powered by shinGETsu.