$a = new SplDoublyLinkedList;$arr=[1,2,3,4,5,6,7,8,9];for($i=0;$i<count($arr);$i++){ $a->add($i,$arr[$i]);}$a->push(11); //push method$a->add(10,12); //add method must with index$a->shift(); //remove array first value$a->unshift(1); //add first value$a->rewind(); //initial from first echo "SplDoublyLinkedList array last/top value " . $a->top() ." \n";echo "SplDoublyLinkedList array count value " . $a->count() ." \n";echo "SplDoublyLinkedList array first/top value " . $a->bottom() . " \n\n";while($a->valid()){ //check with valid method echo 'key ', $a->key(), ' value ', $a->current(),"\n"; //key and current method use here $a->next(); //next method use here}$a->pop(); //remove array last valueprint_r($a);$s=$a->serialize();echo $s;//OutputSplDoublyLinkedList array last/top value 12 SplDoublyLinkedList array count value 11 SplDoublyLinkedList array first/top value 1 key 0 value 1key 1 value 2key 2 value 3key 3 value 4key 4 value 5key 5 value 6key 6 value 7key 7 value 8key 8 value 9key 9 value 11key 10 value 12SplDoublyLinkedList Object( [flags:SplDoublyLinkedList:private] => 0 [dllist:SplDoublyLinkedList:private] => Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] => 6 [6] => 7 [7] => 8 [8] => 9 [9] => 11 ))i:0;:i:1;:i:2;:i:3;:i:4;:i:5;:i:6;:i:7;:i:8;:i:9;:i:11;