<?php
$stack = array("orange", "banana", "apple", "raspberry");
$fruit = array_pop($stack);
print_r($stack);
?>
After this, $stack will have only 3 elements:
Array
(
[0] => orange
[1] => banana
[2] => apple
)
and raspberry will be assigned to
$fruit.