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 = array_push(explode(",", $testdata),array_sum(explode(",", $testdata))); $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/cPkdM
function name:  (null)
number of ops:  31
compiled vars:  !0 = $output, !1 = $testdata, !2 = $input
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                                               'array_push'
          3        INIT_FCALL                                               'explode'
          4        SEND_VAL                                                 '%2C'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $5      
          7        SEND_VAR_NO_REF                               0          $5
          8        INIT_FCALL                                               'array_sum'
          9        INIT_FCALL                                               'explode'
         10        SEND_VAL                                                 '%2C'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $6      
         13        SEND_VAR                                                 $6
         14        DO_ICALL                                         $7      
         15        SEND_VAR                                                 $7
         16        DO_ICALL                                         $8      
         17        ASSIGN                                                   !2, $8
   10    18        INIT_FCALL                                               'array_map'
         19        INIT_FCALL                                               'addarrays'
         20        DO_FCALL                                      0  $10     
         21        SEND_VAR                                                 $10
         22        SEND_VAR                                                 !0
         23        SEND_VAR                                                 !2
         24        DO_ICALL                                         $11     
         25        ASSIGN                                                   !0, $11
   11    26        INIT_FCALL                                               'var_dump'
         27        FETCH_CONSTANT                                   ~13     'output'
         28        SEND_VAL                                                 ~13
         29        DO_ICALL                                                 
   13    30      > RETURN                                                   1

Function addarrays:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cPkdM
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:
153.23 ms | 1399 KiB | 24 Q