3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array_a = [[ 'date' => '2018-02-25 15:12', 'request' => 0, ],[ 'date' => '2018-02-25 15:13', 'request' => 0 ],[ 'date' => '2018-02-25 15:14', 'request' => 0 ],[ 'date' => '2018-02-25 15:15', 'request' => 0 ]]; $array_b = [[ 'date' => '2018-02-25 15:12', 'request' => 11 ],[ 'date' => '2018-02-25 15:13', 'request' => 5 ],[ 'date' => '2018-02-25 15:15', 'request' => 2 ]]; $array_c = array_values(array_reduce( array_merge($array_a, $array_b), function($carry, $item) { $carry[$item['date']] = $item; return $carry; }, [] )); var_dump($array_c);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fSVoj
function name:  (null)
number of ops:  20
compiled vars:  !0 = $array_a, !1 = $array_b, !2 = $array_c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   17     1        ASSIGN                                                   !1, <array>
   28     2        INIT_FCALL                                               'array_values'
          3        INIT_FCALL                                               'array_reduce'
   29     4        INIT_FCALL                                               'array_merge'
          5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $5      
          8        SEND_VAR                                                 $5
   30     9        DECLARE_LAMBDA_FUNCTION                          ~6      [0]
   33    10        SEND_VAL                                                 ~6
   34    11        SEND_VAL                                                 <array>
   28    12        DO_ICALL                                         $7      
   34    13        SEND_VAR                                                 $7
   28    14        DO_ICALL                                         $8      
         15        ASSIGN                                                   !2, $8
   37    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                                 
         19      > 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/fSVoj
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $carry, !1 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   31     2        FETCH_DIM_R                                      ~2      !1, 'date'
          3        ASSIGN_DIM                                               !0, ~2
          4        OP_DATA                                                  !1
   32     5      > RETURN                                                   !0
   33     6*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.68 ms | 1013 KiB | 17 Q