首页 >php教程 >php手册 >PHP5.5 SplStack

PHP5.5 SplStack

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB原创
2016-06-06 19:37:571479浏览

无详细内容 无 ?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

<?php
$stack = new SplStack();

// LIFO
echo "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 $val) {
	echo $val. "\n";
}

?>
PHP5.5 SplStack
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn