summaryrefslogtreecommitdiff
path: root/ext/spl/tests/SplDoublyLinkedList_lifoMode.phpt
blob: 86a84567a86431079ad6eaa2890b88a19d344bc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--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