(沒有版本資訊,可能只在 Git 中)
Ds\Pair::copy — 傳回鍵值對的淺層拷貝
此函式沒有參數。
傳回鍵值對的淺層拷貝。
範例 #1 Ds\Pair::copy() 範例
<?php
$a = new \Ds\Pair("a", 1);
$b = $a->copy();
$a->key = "x";
print_r($a);
print_r($b);
?>
以上範例將輸出類似以下的內容:
Ds\Pair Object ( [key] => x [value] => 1 ) Ds\Pair Object ( [key] => a [value] => 1 )