3v4l.org

run code in 300+ PHP versions simultaneously
<?php $myArray = Array ( Array ( 'id' => 6, 'title' => 'zzz', 'parentID' => 0, 'parentName' =>'', 'section' => 'articles', 'sort' => 0, 'level' => 0 ), Array ( Array ( 'id' => 7, 'title' => 7, 'parentID' => 6, 'parentName' => '', 'section' => 'articles', 'sort' => 0, 'level' => 0 ), Array ( Array ( 'id' => 8, 'title' => 8, 'parentID' => 7, 'parentName' =>'' , 'section' => 'articles', 'sort' => 0, 'level' => 0 ) ) ), Array ( 'id' => 1, 'title' => '?a?3?a', 'parentID' => 0, 'parentName' => '', 'section' => 'articles', 'sort' => 0, 'level' => 0 ), Array ( Array ( 'id' => 4, 'title' => 4, 'parentID' => 1, 'parentName' => '', 'section' => 'articles', 'sort' => 0, 'level' => 0 ), Array ( 'id' => 5, 'title' => 5, 'parentID' => 1, 'parentName' => '', 'section' => 'articles', 'sort' => 0, 'level' => 0 ) ) ); 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/2lLLv
function name:  (null)
number of ops:  6
compiled vars:  !0 = $myArray
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   96     1        INIT_FCALL                                               'arraystack'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 0
          4        DO_FCALL                                      0          
          5      > 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/2lLLv
function name:  arrayStack
number of ops:  24
compiled vars:  !0 = $array, !1 = $dash, !2 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   83     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   85     2      > FE_RESET_R                                       $3      !0, ->22
          3    > > FE_FETCH_R                                               $3, !2, ->22
   86     4    >   ISSET_ISEMPTY_DIM_OBJ                         0          !2, 'id'
          5      > JMPZ                                                     ~4, ->15
   87     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
   89    15    >   PRE_INC                                                  !1
   90    16        INIT_FCALL_BY_NAME                                       'arrayStack'
         17        SEND_VAR_EX                                              !2
         18        SEND_VAR_EX                                              !1
         19        DO_FCALL                                      0          
   91    20        PRE_DEC                                                  !1
   85    21    > > JMP                                                      ->3
         22    >   FE_FREE                                                  $3
   95    23      > RETURN                                                   null

End of function arraystack

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
266 ms | 1399 KiB | 17 Q