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