3v4l.org

run code in 300+ PHP versions simultaneously
<?php $doubly=new SplDoublyLinkedList(); $doubly->push(array('name'=>'Naruto')); $doubly->push(array('name'=>'Sakura')); $doubly->push(array('name'=>'Neji')); $doubly->push(array('name'=>'Sasuke')); var_dump($doubly); echo "\r\n FIFO Traversing \r\n"; $doubly->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO | SplDoublyLinkedList::IT_MODE_KEEP); $doubly->rewind(); foreach($doubly as $key=>$value) { echo "\r\nTraversed:".$key.' '.$value['name']; } echo "\r\nLIFO Traversing - Keep mode \r\n"; $doubly->setIteratorMode(SplDoublyLinkedList::IT_MODE_LIFO | SplDoublyLinkedList::IT_MODE_KEEP); $doubly->rewind(); foreach($doubly as $key=>$value) { echo "\r\nTraversed:".$key.' '.$value['name']; } echo "\r\nLIFO Traversing - Delete mode \r\n"; $doubly->setIteratorMode(SplDoublyLinkedList::IT_MODE_LIFO | SplDoublyLinkedList::IT_MODE_DELETE); $doubly->rewind(); foreach($doubly as $key=>$value) { if($key == 2) break; echo "\r\nTraversed:".$key.' '.$value['name']; } var_dump($doubly);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 25, Position 2 = 33
Branch analysis from position: 25
2 jumps found. (Code = 78) Position 1 = 26, Position 2 = 33
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
Branch analysis from position: 33
2 jumps found. (Code = 77) Position 1 = 41, Position 2 = 49
Branch analysis from position: 41
2 jumps found. (Code = 78) Position 1 = 42, Position 2 = 49
Branch analysis from position: 42
1 jumps found. (Code = 42) Position 1 = 41
Branch analysis from position: 41
Branch analysis from position: 49
2 jumps found. (Code = 77) Position 1 = 57, Position 2 = 68
Branch analysis from position: 57
2 jumps found. (Code = 78) Position 1 = 58, Position 2 = 68
Branch analysis from position: 58
2 jumps found. (Code = 43) Position 1 = 61, Position 2 = 62
Branch analysis from position: 61
1 jumps found. (Code = 42) Position 1 = 68
Branch analysis from position: 68
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 62
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
Branch analysis from position: 68
Branch analysis from position: 68
Branch analysis from position: 49
Branch analysis from position: 33
filename:       /in/pPMKV
function name:  (null)
number of ops:  73
compiled vars:  !0 = $doubly, !1 = $value, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $3      'SplDoublyLinkedList'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    4     3        INIT_METHOD_CALL                                         !0, 'push'
          4        SEND_VAL_EX                                              <array>
          5        DO_FCALL                                      0          
    5     6        INIT_METHOD_CALL                                         !0, 'push'
          7        SEND_VAL_EX                                              <array>
          8        DO_FCALL                                      0          
    6     9        INIT_METHOD_CALL                                         !0, 'push'
         10        SEND_VAL_EX                                              <array>
         11        DO_FCALL                                      0          
    7    12        INIT_METHOD_CALL                                         !0, 'push'
         13        SEND_VAL_EX                                              <array>
         14        DO_FCALL                                      0          
    8    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                                 
    9    18        ECHO                                                     '%0D%0A+FIFO+Traversing+%0D%0A'
   10    19        INIT_METHOD_CALL                                         !0, 'setIteratorMode'
         20        SEND_VAL_EX                                              0
         21        DO_FCALL                                      0          
   11    22        INIT_METHOD_CALL                                         !0, 'rewind'
         23        DO_FCALL                                      0          
   12    24      > FE_RESET_R                                       $13     !0, ->33
         25    > > FE_FETCH_R                                       ~14     $13, !1, ->33
         26    >   ASSIGN                                                   !2, ~14
   14    27        CONCAT                                           ~16     '%0D%0ATraversed%3A', !2
         28        CONCAT                                           ~17     ~16, '+'
         29        FETCH_DIM_R                                      ~18     !1, 'name'
         30        CONCAT                                           ~19     ~17, ~18
         31        ECHO                                                     ~19
   12    32      > JMP                                                      ->25
         33    >   FE_FREE                                                  $13
   16    34        ECHO                                                     '%0D%0ALIFO+Traversing+-+Keep+mode+%0D%0A'
   17    35        INIT_METHOD_CALL                                         !0, 'setIteratorMode'
         36        SEND_VAL_EX                                              2
         37        DO_FCALL                                      0          
   18    38        INIT_METHOD_CALL                                         !0, 'rewind'
         39        DO_FCALL                                      0          
   19    40      > FE_RESET_R                                       $22     !0, ->49
         41    > > FE_FETCH_R                                       ~23     $22, !1, ->49
         42    >   ASSIGN                                                   !2, ~23
   21    43        CONCAT                                           ~25     '%0D%0ATraversed%3A', !2
         44        CONCAT                                           ~26     ~25, '+'
         45        FETCH_DIM_R                                      ~27     !1, 'name'
         46        CONCAT                                           ~28     ~26, ~27
         47        ECHO                                                     ~28
   19    48      > JMP                                                      ->41
         49    >   FE_FREE                                                  $22
   24    50        ECHO                                                     '%0D%0ALIFO+Traversing+-+Delete+mode+%0D%0A'
   25    51        INIT_METHOD_CALL                                         !0, 'setIteratorMode'
         52        SEND_VAL_EX                                              3
         53        DO_FCALL                                      0          
   26    54        INIT_METHOD_CALL                                         !0, 'rewind'
         55        DO_FCALL                                      0          
   28    56      > FE_RESET_R                                       $31     !0, ->68
         57    > > FE_FETCH_R                                       ~32     $31, !1, ->68
         58    >   ASSIGN                                                   !2, ~32
   30    59        IS_EQUAL                                                 !2, 2
         60      > JMPZ                                                     ~34, ->62
         61    > > JMP                                                      ->68
   31    62    >   CONCAT                                           ~35     '%0D%0ATraversed%3A', !2
         63        CONCAT                                           ~36     ~35, '+'
         64        FETCH_DIM_R                                      ~37     !1, 'name'
         65        CONCAT                                           ~38     ~36, ~37
         66        ECHO                                                     ~38
   28    67      > JMP                                                      ->57
         68    >   FE_FREE                                                  $31
   33    69        INIT_FCALL                                               'var_dump'
         70        SEND_VAR                                                 !0
         71        DO_ICALL                                                 
         72      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.7 ms | 1405 KiB | 15 Q