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

search for in the

ArrayIterator::getFlags> <ArrayIterator::current
[edit] Last updated: Fri, 17 May 2013

view this page in

ArrayIterator::getArrayCopy

(PHP 5 >= 5.0.0)

ArrayIterator::getArrayCopyRécupère la copie d'un tableau

Description

public array ArrayIterator::getArrayCopy ( void )

Récupère la copie d'un tableau.

Avertissement

Cette fonction n'est pas documentée et seule la liste des arguments est disponible.

Liste de paramètres

Cette fonction ne contient aucun paramètre.

Valeurs de retour

Une copie d'un tableau, ou un tableau de propriétés publiques si ArrayIterator se réfère à un objet.

Voir aussi



add a note add a note User Contributed Notes ArrayIterator::getArrayCopy - [1 notes]
up
0
lenye01 at gmail dot com
2 years ago
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