3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array( array( 'week' => 26, '#orders_CA' => 0, 'cost_CA' => 0, '#orders_US' => 3, 'cost_US' => 18.99, '#orders_INTERNATIONAL' => 0, 'cost_INTERNATIONAL' => 0 ), array( 'week' => 26, '#orders_CA' => 0, 'cost_CA' => 0, '#orders_US' => 0, 'cost_US' => 0, '#orders_INTERNATIONAL' => 22, 'cost_INTERNATIONAL' => 32 ), ); $keys = array_keys($a); $res = call_user_func_array('array_map', array_merge(array(function() { return array_sum(func_get_args()); }), $a)); print_r($res); print_r(array_combine($keys, $res));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pf3mm
function name:  (null)
number of ops:  27
compiled vars:  !0 = $a, !1 = $keys, !2 = $res
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   22     1        INIT_FCALL                                               'array_keys'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !1, $4
   24     5        INIT_FCALL                                               'array_map'
          6        INIT_FCALL                                               'array_merge'
          7        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fpf3mm%3A24%240'
   26     8        INIT_ARRAY                                       ~7      ~6
          9        SEND_VAL                                                 ~7
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $8      
         12        SEND_ARRAY                                               $8
         13        CHECK_UNDEF_ARGS                                         
         14        DO_FCALL                                      0  $9      
   24    15        ASSIGN                                                   !2, $9
   27    16        INIT_FCALL                                               'print_r'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                                 
   28    19        INIT_FCALL                                               'print_r'
         20        INIT_FCALL                                               'array_combine'
         21        SEND_VAR                                                 !1
         22        SEND_VAR                                                 !2
         23        DO_ICALL                                         $12     
         24        SEND_VAR                                                 $12
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fpf3mm%3A24%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pf3mm
function name:  {closure}
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   INIT_FCALL                                               'array_sum'
          1        FUNC_GET_ARGS                                    ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                         $1      
          4      > RETURN                                                   $1
   26     5*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fpf3mm%3A24%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.65 ms | 941 KiB | 26 Q