The pop() method removes the last element and returns that element
<?php use kim\present\utils\arrays\ArrayUtils; $arrayUtils = ArrayUtils::from(["Apple", "Banana", "Carrot"]); //Gets last value $arrayUtils->pop(); // expected output: "Carrot" $arrayUtils; // expected output: ["Apple", "Banana"]
$arrayUtils->pop() : mixed;
The last value of array.
ArrayUtils::pop() : mixed;
Last updated 4 years ago