PHP5.5 SplStack
程序员文章站
2022-05-10 23:39:49
...
无详细内容 无 ?php$stack = new SplStack();// LIFOecho "Stack PUSH\n";$stack[] = 'A';$stack-push('B');$stack-push('C');$stack[] = 'D';$stack[] = 'E';foreach($stack as $val) {echo $val. "\n";}$stack-pop();echo "Stack POP\n";foreach($stack as
push('B'); $stack->push('C'); $stack[] = 'D'; $stack[] = 'E'; foreach($stack as $val) { echo $val. "\n"; } $stack->pop(); echo "Stack POP\n"; foreach($stack as $val) { echo $val. "\n"; } ?>
推荐阅读