(PECL ds >= 1.0.0)
Ds\Map::merge — 返回添加所有给定关联的结果
示例 #1 Ds\Map::merge() 示例
<?php
$map = new \Ds\Map(["a" => 1, "b" => 2, "c" => 3]);
print_r($map->merge(["a" => 10, "e" => 50]));
?>
上面的示例将输出类似以下内容
Ds\Map Object ( [0] => Ds\Pair Object ( [key] => a [value] => 10 ) [1] => Ds\Pair Object ( [key] => b [value] => 2 ) [2] => Ds\Pair Object ( [key] => c [value] => 3 ) [3] => Ds\Pair Object ( [key] => e [value] => 50 ) )