3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = array( "2018-08-30" => 8, "2018-08-31" => 2, "2018-09-04" => 4, "2018-09-20" => 1, "2018-09-24" => 1, "2018-09-27" => 2, ); $dateRanges = array( "2018-08-28" => 0, "2018-08-29" => 1, "2018-08-30" => 2, "2018-08-31" => 3, "2018-09-01" => 4, "2018-09-02" => 5, "2018-09-03" => 6, "2018-09-04" => 7, "2018-09-05" => 8, "2018-09-06" => 9, "2018-09-07" => 10, "2018-09-08" => 11, "2018-09-09" => 12, "2018-09-10" => 13, "2018-09-11" => 14, "2018-09-12" => 15, "2018-09-13" => 16, "2018-09-14" => 17, "2018-09-15" => 18, "2018-09-16" => 19, "2018-09-17" => 20, "2018-09-18" => 21, "2018-09-19" => 22, "2018-09-20" => 23, "2018-09-21" => 24, "2018-09-22" => 25, "2018-09-23" => 26, "2018-09-24" => 27, "2018-09-25" => 28, "2018-09-26" => 29, "2018-09-27" => 30 ); $newArr = array_merge(array_map(function($v){return 0;}, $dateRanges), $result); print_r($newArr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SlF0J
function name:  (null)
number of ops:  16
compiled vars:  !0 = $result, !1 = $dateRanges, !2 = $newArr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   10     1        ASSIGN                                                   !1, <array>
   44     2        INIT_FCALL                                               'array_merge'
          3        INIT_FCALL                                               'array_map'
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FSlF0J%3A44%240'
          5        SEND_VAL                                                 ~5
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $6      
          8        SEND_VAR                                                 $6
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $7      
         11        ASSIGN                                                   !2, $7
   45    12        INIT_FCALL                                               'print_r'
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FSlF0J%3A44%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SlF0J
function name:  {closure}
number of ops:  3
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   44     0  E >   RECV                                             !0      
          1      > RETURN                                                   0
          2*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FSlF0J%3A44%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.58 ms | 1399 KiB | 19 Q