3v4l.org

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

Function sumup:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 9
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 9
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/so5V3
function name:  sumup
number of ops:  12
compiled vars:  !0 = $items, !1 = $sum, !2 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        ASSIGN                                                   !1, 0
    6     2      > FE_RESET_R                                       $4      !0, ->9
          3    > > FE_FETCH_R                                               $4, !2, ->9
    8     4    >   FETCH_DIM_R                                      ~5      !2, 'a'
          5        FETCH_DIM_R                                      ~6      !2, 'b'
          6        MUL                                              ~7      ~5, ~6
          7        ASSIGN_OP                                     1          !1, ~7
    6     8      > JMP                                                      ->3
          9    >   FE_FREE                                                  $4
   10    10      > RETURN                                                   !1
   11    11*     > RETURN                                                   null

End of function sumup

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.89 ms | 1398 KiB | 16 Q