array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'tr', ), 'this' => array ( 0 => 'ds-set.copy.php', 1 => 'Ds\\Set::copy', ), 'up' => array ( 0 => 'class.ds-set.php', 1 => 'Ds\\Set', ), 'prev' => array ( 0 => 'ds-set.contains.php', 1 => 'Ds\\Set::contains', ), 'next' => array ( 0 => 'ds-set.count.php', 1 => 'Ds\\Set::count', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/ds/ds/set/copy.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL ds >= 1.0.0)
Ds\Set::copy — Returns a shallow copy of the set
Bu işlevin bağımsız değişkeni yoktur.
Returns a shallow copy of the set.
Örnek 1 Ds\Set::copy() example
<?php
$a = new \Ds\Set([1, 2, 3]);
$b = $a->copy();
// Updating the copy doesn't affect the original
$b->add(4);
print_r($a);
print_r($b);
?>
Yukarıdaki örnek şuna benzer bir çıktı üretir:
Ds\Set Object ( [0] => 1 [1] => 2 [2] => 3 ) Ds\Set Object ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 )