(PECL ds >= 1.0.0)
Ds\Map::last — 傳回映射的最後一組鍵值對
此函式沒有參數。
映射的最後一組鍵值對。
如果為空,則拋出 UnderflowException。
範例 #1 Ds\Map::last() 範例
<?php
$map = new \Ds\Map(["a" => 1, "b" => 2, "c" => 3]);
var_dump($map->last());
?>
上述範例會輸出類似以下的內容:
object(Ds\Pair)#2 (2) { ["key"]=> string(1) "c" ["value"]=> int(3) }