3v4l.org

run code in 300+ PHP versions simultaneously
<?php function arrayStack( $array, $dash ){ foreach($array as $value){ if(isset($value['id'])){ echo str_repeat("-", $dash).$value['id'].'<br/>'; }else{ $dash++; arrayStack( $value, $dash ); $dash--; } } } arrayStack( $myArray, 0 );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5v57j
function name:  (null)
number of ops:  5
compiled vars:  !0 = $myArray
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'arraystack'
          1        SEND_VAR                                                 !0
          2        SEND_VAL                                                 0
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Function arraystack:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 22
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 22
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 15
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/5v57j
function name:  arrayStack
number of ops:  24
compiled vars:  !0 = $array, !1 = $dash, !2 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2      > FE_RESET_R                                       $3      !0, ->22
          3    > > FE_FETCH_R                                               $3, !2, ->22
    6     4    >   ISSET_ISEMPTY_DIM_OBJ                         0          !2, 'id'
          5      > JMPZ                                                     ~4, ->15
    7     6    >   INIT_FCALL                                               'str_repeat'
          7        SEND_VAL                                                 '-'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $5      
         10        FETCH_DIM_R                                      ~6      !2, 'id'
         11        CONCAT                                           ~7      $5, ~6
         12        CONCAT                                           ~8      ~7, '%3Cbr%2F%3E'
         13        ECHO                                                     ~8
         14      > JMP                                                      ->21
    9    15    >   PRE_INC                                                  !1
   10    16        INIT_FCALL_BY_NAME                                       'arrayStack'
         17        SEND_VAR_EX                                              !2
         18        SEND_VAR_EX                                              !1
         19        DO_FCALL                                      0          
   11    20        PRE_DEC                                                  !1
    5    21    > > JMP                                                      ->3
         22    >   FE_FREE                                                  $3
   15    23      > RETURN                                                   null

End of function arraystack

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.58 ms | 1399 KiB | 16 Q