3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* function loop($array) { echo '<ol class="dd-list">'; $arrayObj = new ArrayObject($array); foreach ( $iterator = $arrayObj->getIterator() as $key => $value ) { if(is_array($value)) { loop($iterator->current()); } else { if($iterator->key()=='position') { echo '<li class="dd-item" data-id="' . $iterator->current() . '">'; echo '<div class="dd-handle">' . $iterator->key() . ' ' . $iterator->current() . '</div>'; echo '</li>'; } } } echo '</ol>'; } */ $testArray = array('1', '2', array('3', '4')); $arrayObj = new ArrayObject($array); foreach ( $iterator = $arrayObj->getIterator() as $key => $value ) { echo 'key ' . $iterator->key(); echo "\n"; echo 'current' . $iterator->current(); echo "\n"; echo "\n"; } //loop($testArray);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 23
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 23
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/L411Z
function name:  (null)
number of ops:  25
compiled vars:  !0 = $testArray, !1 = $arrayObj, !2 = $array, !3 = $iterator, !4 = $value, !5 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   ASSIGN                                                   !0, <array>
   21     1        NEW                                              $7      'ArrayObject'
          2        SEND_VAR_EX                                              !2
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $7
   22     5        INIT_METHOD_CALL                                         !1, 'getIterator'
          6        DO_FCALL                                      0  $10     
          7        ASSIGN                                           ~11     !3, $10
          8      > FE_RESET_R                                       $12     ~11, ->23
          9    > > FE_FETCH_R                                       ~13     $12, !4, ->23
         10    >   ASSIGN                                                   !5, ~13
   23    11        INIT_METHOD_CALL                                         !3, 'key'
         12        DO_FCALL                                      0  $15     
         13        CONCAT                                           ~16     'key+', $15
         14        ECHO                                                     ~16
   24    15        ECHO                                                     '%0A'
   25    16        INIT_METHOD_CALL                                         !3, 'current'
         17        DO_FCALL                                      0  $17     
         18        CONCAT                                           ~18     'current', $17
         19        ECHO                                                     ~18
   26    20        ECHO                                                     '%0A'
   27    21        ECHO                                                     '%0A'
   22    22      > JMP                                                      ->9
         23    >   FE_FREE                                                  $12
   30    24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.45 ms | 1394 KiB | 13 Q