3v4l.org

run code in 300+ PHP versions simultaneously
<?php function sum(array $ints): int { array_walk($ints, function(int $int) {}); $a = 0; foreach ($ints as $int) { $a += $int; } return $a; } var_dump(sum([1, 2, 3])); var_dump(sum([1, 2, "three"]));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TRTF9
function name:  (null)
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'sum'
          2        SEND_VAL                                                 <array>
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
   14     6        INIT_FCALL                                               'var_dump'
          7        INIT_FCALL                                               'sum'
          8        SEND_VAL                                                 <array>
          9        DO_FCALL                                      0  $2      
         10        SEND_VAR                                                 $2
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Function sum:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/TRTF9
function name:  sum
number of ops:  16
compiled vars:  !0 = $ints, !1 = $a, !2 = $int
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'array_walk'
          2        SEND_REF                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FTRTF9%3A5%240'
          4        SEND_VAL                                                 ~3
          5        DO_ICALL                                                 
    6     6        ASSIGN                                                   !1, 0
    7     7      > FE_RESET_R                                       $6      !0, ->11
          8    > > FE_FETCH_R                                               $6, !2, ->11
    8     9    >   ASSIGN_OP                                     1          !1, !2
    7    10      > JMP                                                      ->8
         11    >   FE_FREE                                                  $6
   10    12        VERIFY_RETURN_TYPE                                       !1
         13      > RETURN                                                   !1
   11    14*       VERIFY_RETURN_TYPE                                       
         15*     > RETURN                                                   null

End of function sum

Function %00%7Bclosure%7D%2Fin%2FTRTF9%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TRTF9
function name:  {closure}
number of ops:  2
compiled vars:  !0 = $int
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FTRTF9%3A5%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.33 ms | 1403 KiB | 19 Q