3v4l.org

run code in 300+ PHP versions simultaneously
<?php $MAP = [ ['x', 'x', 'x', 'x'], ['x', 's', 'p', 'x'], ['x', 'p', 'p', 'x'], ['x', 'p', 'p', 'x'], ['x', 'p', 'p', 'x'], ['x', 'p', 'p', 'x'], ['x', 'x', 'x', 'x'], ]; $iterator = new RecursiveIteratorIterator(new RecursiveArrayIterator($MAP), RecursiveIteratorIterator::SELF_FIRST); $parentKey = null; foreach($iterator as $key => $value) { if (is_scalar($value)) { var_dump($parentKey.'/'.$key.' => '.$value); } else { $parentKey = $key; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 25
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 25
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 23
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/ibEBH
function name:  (null)
number of ops:  27
compiled vars:  !0 = $MAP, !1 = $iterator, !2 = $parentKey, !3 = $value, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   13     1        NEW                                              $6      'RecursiveIteratorIterator'
          2        NEW                                              $7      'RecursiveArrayIterator'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
          5        SEND_VAR_NO_REF_EX                                       $7
          6        SEND_VAL_EX                                              1
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !1, $6
   15     9        ASSIGN                                                   !2, null
   16    10      > FE_RESET_R                                       $12     !1, ->25
         11    > > FE_FETCH_R                                       ~13     $12, !3, ->25
         12    >   ASSIGN                                                   !4, ~13
   17    13        TYPE_CHECK                                  124          !3
         14      > JMPZ                                                     ~15, ->23
   18    15    >   INIT_FCALL                                               'var_dump'
         16        CONCAT                                           ~16     !2, '%2F'
         17        CONCAT                                           ~17     ~16, !4
         18        CONCAT                                           ~18     ~17, '+%3D%3E+'
         19        CONCAT                                           ~19     ~18, !3
         20        SEND_VAL                                                 ~19
         21        DO_ICALL                                                 
   17    22      > JMP                                                      ->24
   20    23    >   ASSIGN                                                   !2, !4
   16    24    > > JMP                                                      ->11
         25    >   FE_FREE                                                  $12
   22    26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.45 ms | 1006 KiB | 14 Q