3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); function sum(int ...$numbers): int { $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/t3p76
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     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/t3p76
function name:  sum
number of ops:  11
compiled vars:  !0 = $numbers, !1 = $acc, !2 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV_VARIADIC                                    !0      
    5     1        ASSIGN                                                   !1, 0
    6     2      > FE_RESET_R                                       $4      !0, ->6
          3    > > FE_FETCH_R                                               $4, !2, ->6
    7     4    >   ASSIGN_OP                                     1          !1, !2
    6     5      > JMP                                                      ->3
          6    >   FE_FREE                                                  $4
    9     7        VERIFY_RETURN_TYPE                                       !1
          8      > RETURN                                                   !1
   10     9*       VERIFY_RETURN_TYPE                                       
         10*     > RETURN                                                   null

End of function sum

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.12 ms | 1409 KiB | 14 Q