3v4l.org

run code in 300+ PHP versions simultaneously
<?php function sum(...$numbers) { $acc = 0; foreach ($numbers as $n) { $acc += $n; } return $acc; } echo sum(1, 2, 3, 4);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gfnfV
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'sum'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 2
          3        SEND_VAL                                                 3
          4        SEND_VAL                                                 4
          5        DO_FCALL                                      0  $0      
          6        ECHO                                                     $0
          7      > RETURN                                                   1

Function sum:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/gfnfV
function name:  sum
number of ops:  9
compiled vars:  !0 = $numbers, !1 = $acc, !2 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV_VARIADIC                                    !0      
    4     1        ASSIGN                                                   !1, 0
    5     2      > FE_RESET_R                                       $4      !0, ->6
          3    > > FE_FETCH_R                                               $4, !2, ->6
    6     4    >   ASSIGN_OP                                     1          !1, !2
    5     5      > JMP                                                      ->3
          6    >   FE_FREE                                                  $4
    8     7      > RETURN                                                   !1
    9     8*     > RETURN                                                   null

End of function sum

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.23 ms | 1397 KiB | 14 Q