PHP 8.5.0 Beta 1 available for testing

Voting

: zero plus seven?
(Example: nine)

The Note You're Voting On

dongchao769390531 at 163 dot com
8 years ago
<?php
$splDoubleLinkedList
= new SplDoublyLinkedList();
$splDoubleLinkedList->push('a');
$splDoubleLinkedList->push('3');
$splDoubleLinkedList->push('v');
$splDoubleLinkedList->push('1');
$splDoubleLinkedList->push('p');
//First of all, we need rewind list
$splDoubleLinkedList->rewind();
//Use while, check if the list has valid node
while ($splDoubleLinkedList->valid()){
//Print current node's value
echo $splDoubleLinkedList->current()."\n";
//Turn the cursor to next node
$splDoubleLinkedList->next();
}
?>

<< Back to user notes page

To Top