3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = array( "settings-main" => array( "option-1" => "val-1", "option-2" => "val-2", "sub-settings" => array( "my-option" => "some val", "my-option-2" => "some val2", ), ), "other-settings" => array( "other" => array( "option-1" => "a", "option-2" => "b", ), ), ); function recursive_arr($input){ foreach($input as $val){ if(is_array($val)){ recursive_arr($val); }else{ echo $val."\n"; } } } recursive_arr($input);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tePKm
function name:  (null)
number of ops:  5
compiled vars:  !0 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   29     1        INIT_FCALL                                               'recursive_arr'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Function recursive_arr:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 12
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 12
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/tePKm
function name:  recursive_arr
number of ops:  14
compiled vars:  !0 = $input, !1 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   20     1      > FE_RESET_R                                       $2      !0, ->12
          2    > > FE_FETCH_R                                               $2, !1, ->12
   21     3    >   TYPE_CHECK                                  128          !1
          4      > JMPZ                                                     ~3, ->9
   22     5    >   INIT_FCALL_BY_NAME                                       'recursive_arr'
          6        SEND_VAR_EX                                              !1
          7        DO_FCALL                                      0          
   21     8      > JMP                                                      ->11
   24     9    >   CONCAT                                           ~5      !1, '%0A'
         10        ECHO                                                     ~5
   20    11    > > JMP                                                      ->2
         12    >   FE_FREE                                                  $2
   27    13      > RETURN                                                   null

End of function recursive_arr

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
230.66 ms | 1001 KiB | 14 Q