3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dateRange = ['2010-01-01', '2010-01-02', '2010-01-03']; $data = ['2010-01-01' => 5, '2010-01-03' => 7]; var_export( array_reduce( $dateRange, fn($result, $date) => $result + [$date => $data[$date] ?? null], [] ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DljO5
function name:  (null)
number of ops:  13
compiled vars:  !0 = $dateRange, !1 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    6     2        INIT_FCALL                                               'var_export'
    7     3        INIT_FCALL                                               'array_reduce'
    8     4        SEND_VAR                                                 !0
    9     5        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
          6        BIND_LEXICAL                                             ~4, !1
          7        SEND_VAL                                                 ~4
   10     8        SEND_VAL                                                 <array>
    7     9        DO_ICALL                                         $5      
   10    10        SEND_VAR                                                 $5
    6    11        DO_ICALL                                                 
   12    12      > 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/DljO5
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $result, !1 = $date, !2 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
          3        FETCH_DIM_IS                                     ~3      !2, !1
          4        COALESCE                                         ~4      ~3
          5        QM_ASSIGN                                        ~4      null
          6        INIT_ARRAY                                       ~5      ~4, !1
          7        ADD                                              ~6      !0, ~5
          8      > RETURN                                                   ~6
          9*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.97 ms | 1011 KiB | 15 Q