3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr1 = [ "Jan 01, 2013" => ["COM" => 100, "RES" => 200, "FOO" => 5], "Oct 28, 2014" => ["COM" => 300, "RES" => 400] ]; $arr2 = [ "Jan 01, 2013" => ["COM" => 10, "RES" => 20], "Oct 28, 2014" => ["COM" => 30, "RES" => 40] ]; var_export( array_map( fn($set) => array_map( fn($v) => array_sum((array) $v), $set ), array_merge_recursive($arr1, $arr2) ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QH7EU
function name:  (null)
number of ops:  16
compiled vars:  !0 = $arr1, !1 = $arr2, !2 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    6     1        ASSIGN                                                   !1, <array>
   11     2        INIT_FCALL                                               'var_export'
   12     3        INIT_FCALL                                               'array_map'
   13     4        DECLARE_LAMBDA_FUNCTION                          ~5      [0]
          5        BIND_LEXICAL                                             ~5, !2
   16     6        SEND_VAL                                                 ~5
   17     7        INIT_FCALL                                               'array_merge_recursive'
          8        SEND_VAR                                                 !0
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $6      
         11        SEND_VAR                                                 $6
   12    12        DO_ICALL                                         $7      
   17    13        SEND_VAR                                                 $7
   11    14        DO_ICALL                                                 
   19    15      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QH7EU
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $set, !1 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        INIT_FCALL                                               'array_map'
   14     3        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
          4        SEND_VAL                                                 ~2
   15     5        SEND_VAR                                                 !0
   13     6        DO_ICALL                                         $3      
   15     7      > RETURN                                                   $3
   16     8*     > RETURN                                                   null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QH7EU
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'array_sum'
          2        CAST                                          7  ~1      !0
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                         $2      
          5      > RETURN                                                   $2
          6*     > RETURN                                                   null

End of Dynamic Function 0

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.58 ms | 1014 KiB | 17 Q