3v4l.org

run code in 300+ PHP versions simultaneously
<?php function addArrays($input,$output) { return array_sum(func_get_args()); } $output = array(0,0,0,0,0); $testdata = "580,680,480,380"; $input = (int)explode(",", $testdata); $subTotal = array_sum(explode(",", $testdata)); array_push($input,$subTotal); $output = array_map(addArrays(), $output, $input); var_dump($output); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bLpI1
function name:  (null)
number of ops:  32
compiled vars:  !0 = $output, !1 = $testdata, !2 = $input, !3 = $subTotal
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, <array>
    8     1        ASSIGN                                                   !1, '580%2C680%2C480%2C380'
    9     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '%2C'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $6      
          6        CAST                                          4  ~7      $6
          7        ASSIGN                                                   !2, ~7
   10     8        INIT_FCALL                                               'array_sum'
          9        INIT_FCALL                                               'explode'
         10        SEND_VAL                                                 '%2C'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $9      
         13        SEND_VAR                                                 $9
         14        DO_ICALL                                         $10     
         15        ASSIGN                                                   !3, $10
   11    16        INIT_FCALL                                               'array_push'
         17        SEND_REF                                                 !2
         18        SEND_VAR                                                 !3
         19        DO_ICALL                                                 
   12    20        INIT_FCALL                                               'array_map'
         21        INIT_FCALL                                               'addarrays'
         22        DO_FCALL                                      0  $13     
         23        SEND_VAR                                                 $13
         24        SEND_VAR                                                 !0
         25        SEND_VAR                                                 !2
         26        DO_ICALL                                         $14     
         27        ASSIGN                                                   !0, $14
   13    28        INIT_FCALL                                               'var_dump'
         29        SEND_VAR                                                 !0
         30        DO_ICALL                                                 
   15    31      > RETURN                                                   1

Function addarrays:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bLpI1
function name:  addArrays
number of ops:  8
compiled vars:  !0 = $input, !1 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        INIT_FCALL                                               'array_sum'
          3        FUNC_GET_ARGS                                    ~2      
          4        SEND_VAL                                                 ~2
          5        DO_ICALL                                         $3      
          6      > RETURN                                                   $3
    5     7*     > RETURN                                                   null

End of function addarrays

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.29 ms | 1394 KiB | 24 Q