3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = [ 310 => 0, 311 => 0, 312 => 0, 313 => 0, 314 => 0, 315 => 0 ]; $array2 = [ "2019-05-17" => [ 312 => 3000.00 ], "2019-06-20" => [ 312 => 3000.00 ], "2019-06-27" => [ 313 => 5000.00, 315 => 3000.00 ] ]; var_export( array_map( function($row) use ($array1) { return array_replace($array1, $row); }, $array2 ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4XjcC
function name:  (null)
number of ops:  12
compiled vars:  !0 = $array1, !1 = $array2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   12     1        ASSIGN                                                   !1, <array>
   25     2        INIT_FCALL                                               'var_export'
   26     3        INIT_FCALL                                               'array_map'
   27     4        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
          5        BIND_LEXICAL                                             ~4, !0
   29     6        SEND_VAL                                                 ~4
   30     7        SEND_VAR                                                 !1
   26     8        DO_ICALL                                         $5      
   30     9        SEND_VAR                                                 $5
   25    10        DO_ICALL                                                 
   32    11      > 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/4XjcC
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $row, !1 = $array1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   28     2        INIT_FCALL                                               'array_replace'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6      > RETURN                                                   $2
   29     7*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147 ms | 1012 KiB | 16 Q