3v4l.org

run code in 300+ PHP versions simultaneously
<?php function addArrays() { return array_sum(func_get_args()); } $output = array(0,0,0,0,0); $testdata = "580,680,480,380"; $input = explode(",", $testdata); $subTotal = array_sum(explode(",", $testdata)); $input = 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/PgniU
function name:  (null)
number of ops:  33
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        ASSIGN                                                   !2, $6
   10     7        INIT_FCALL                                               'array_sum'
          8        INIT_FCALL                                               'explode'
          9        SEND_VAL                                                 '%2C'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $8      
         12        SEND_VAR                                                 $8
         13        DO_ICALL                                         $9      
         14        ASSIGN                                                   !3, $9
   11    15        INIT_FCALL                                               'array_push'
         16        SEND_REF                                                 !2
         17        SEND_VAR                                                 !3
         18        DO_ICALL                                         $11     
         19        ASSIGN                                                   !2, $11
   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        FETCH_CONSTANT                                   ~16     'output'
         30        SEND_VAL                                                 ~16
         31        DO_ICALL                                                 
   15    32      > RETURN                                                   1

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

End of function addarrays

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.4 ms | 1399 KiB | 24 Q