3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array(1,2,3,4,5,6,7,8,9); function walk($a, $index = 2){ if (count($a) == $index +1) { echo($a[$index]); } else { echo($a[$index]); walk($a, $index +1); } } walk($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5tnu3
function name:  (null)
number of ops:  5
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   15     1        INIT_FCALL                                               'walk'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Function walk:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5tnu3
function name:  walk
number of ops:  17
compiled vars:  !0 = $a, !1 = $index
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      2
    5     2        COUNT                                            ~2      !0
          3        ADD                                              ~3      !1, 1
          4        IS_EQUAL                                                 ~2, ~3
          5      > JMPZ                                                     ~4, ->9
    6     6    >   FETCH_DIM_R                                      ~5      !0, !1
          7        ECHO                                                     ~5
          8      > JMP                                                      ->16
    8     9    >   FETCH_DIM_R                                      ~6      !0, !1
         10        ECHO                                                     ~6
    9    11        INIT_FCALL_BY_NAME                                       'walk'
         12        SEND_VAR_EX                                              !0
         13        ADD                                              ~7      !1, 1
         14        SEND_VAL_EX                                              ~7
         15        DO_FCALL                                      0          
   13    16    > > RETURN                                                   null

End of function walk

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.12 ms | 1389 KiB | 14 Q