3v4l.org

run code in 300+ PHP versions simultaneously
<?php function sum($arr) { if ( empty($arr) ) { return; } return $arr[0] + sum(array_slice($arr, 1)); } echo sum(array(1,2,3,4,5));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rAUj6
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'sum'
          1        SEND_VAL                                                 <array>
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function sum:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rAUj6
function name:  sum
number of ops:  15
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        ISSET_ISEMPTY_CV                                         !0
          2      > JMPZ                                                     ~1, ->4
    4     3    > > RETURN                                                   null
    6     4    >   FETCH_DIM_R                                      ~2      !0, 0
          5        INIT_FCALL_BY_NAME                                       'sum'
          6        INIT_FCALL                                               'array_slice'
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 1
          9        DO_ICALL                                         $3      
         10        SEND_VAR_NO_REF_EX                                       $3
         11        DO_FCALL                                      0  $4      
         12        ADD                                              ~5      ~2, $4
         13      > RETURN                                                   ~5
    7    14*     > RETURN                                                   null

End of function sum

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.75 ms | 1401 KiB | 16 Q