downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

ArrayIterator::getFlags> <ArrayIterator::current
[edit] Last updated: Fri, 25 May 2012

view this page in

ArrayIterator::getArrayCopy

(PHP 5 >= 5.0.0)

ArrayIterator::getArrayCopy配列のコピーを取得する

説明

public array ArrayIterator::getArrayCopy ( void )

配列のコピーを取得します。

警告

この関数は、 現在のところ詳細な情報はありません。引数のリストのみが 記述されています。

パラメータ

この関数にはパラメータはありません。

返り値

配列のコピーを返します。 ArrayIterator がオブジェクトを参照している場合は public プロパティの配列を返します。

参考



add a note add a note User Contributed Notes ArrayIterator::getArrayCopy
lenye01 at gmail dot com 11-Feb-2011 02:20
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" } }

 
show source | credits | stats | sitemap | contact | advertising | mirror sites