note 102386 added to arrayiterator.getarraycopy

[email protected] Fri, 11 Feb 2011 02:20:18 -0800
Newsgroups php.notes
Message-ID <[email protected]>
the difference of this method and the direct assign the object to a value is as follows:

<?php
$b = array('name'=>'mengzhi','age'=>'12','city'=>'shanghai');
$a = new ArrayIterator($b);
$a->append(array('home'=>'china','work'=>'developer'));
$c = $a->getArrayCopy();
var_dump($a);
var_dump($c);
?>
result:
object(ArrayIterator)#1 (1) { ["storage":"ArrayIterator":private]=> array(4) { ["name"]=> string(7) "mengzhi" ["age"]=> string(2) "12" ["city"]=> string(8) "shanghai" [0]=> array(2) { ["home"]=> string(5) "china" ["work"]=> string(9) "developer" } } } 

array(4) { ["name"]=> string(7) "mengzhi" ["age"]=> string(2) "12" ["city"]=> string(8) "shanghai" [0]=> array(2) { ["home"]=> string(5) "china" ["work"]=> string(9) "developer" } }
----
Server IP: 69.147.83.197
Probable Submitter: 221.133.228.74
----
Manual Page -- http://www.php.net/manual/en/arrayiterator.getarraycopy.php
Edit        -- https://master.php.net/note/edit/102386
Del: integrated  -- https://master.php.net/note/delete/102386/integrated
Del: useless     -- https://master.php.net/note/delete/102386/useless
Del: bad code    -- https://master.php.net/note/delete/102386/bad+code
Del: spam        -- https://master.php.net/note/delete/102386/spam
Del: non-english -- https://master.php.net/note/delete/102386/non-english
Del: in docs     -- https://master.php.net/note/delete/102386/in+docs
Del: other reasons-- https://master.php.net/note/delete/102386
Reject      -- https://master.php.net/note/reject/102386
Search      -- https://master.php.net/manage/user-notes.php