php-src/ext/spl/tests/SplDoublyLinkedList_lifoMode.phpt
2009-05-23 15:38:18 +00:00

23 lines
407 B
PHP

--TEST--
Check that SplDoublyLinkedList can traverse backwards
--CREDITS--
Rob Knight <themanhimself@robknight.org.uk> PHPNW Test Fest 2009
--FILE--
<?php
$list = new SplDoublyLinkedList();
$list->push('o');
$list->push('o');
$list->push('f');
$list->setIteratorMode(SplDoublyLinkedList::IT_MODE_LIFO);
$list->rewind();
while ($tmp = $list->current()) {
echo $tmp;
$list->next();
}
?>
--EXPECT--
foo