数组和集合

<?php

$stack = [];
//push operation
array_unshift($stack, 1);
array_unshift($stack, 3);
array_unshift($stack, 5);

$top = current($stack);
//pop operation
//top is 5
$first = array_shift($stack);
//first is 5
$second = array_shift($stack);
//second is 3
$third = array_shift($stack);
//third is 1

echo $top, "\n";
echo $first, "\n";
echo $second, "\n";
echo $third, "\n";