Home > php教程 > php手册 > body text

PHP5.5 SplStack

WBOY
Release: 2016-06-06 19:37:57
Original
1423 people have browsed it

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

?>
Copy after login
PHP5.5 SplStack
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template