php-src/ext/spl/tests/SplDoublyLinkedList_lifoMode.phpt

23 lines
407 B
Plaintext
Raw Normal View History

2009-05-23 15:37:36 +00:00
--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