View Problem

Remove the last element of a list

ExpandDiskEdit
php
$list = array("Apple", "Banana", "Carrot");
unset($list[count($list)-1]);

// Be aware of that
// $list[] = "Orange";
// will be $list[3] and not $list[2]
ExpandDiskEdit
php
$list = array("Apple", "Banana", "Carrot");
array_pop($list);
DiskEdit
clojure
(pop ["Apple" "Banana" "Carrot"])
ExpandDiskEdit
cpp C++/CLI .NET 2.0
fruit->RemoveAt(fruit->Count - 1);

Submit a new solution for php, clojure, or cpp
There are 20 other solutions in additional languages (csharp, erlang, fantom, fsharp ...)