3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = [ "category" => "Music", "items" => [ ["ID" => "1", "start_date" => "2018-11-20", "end_date" => "2018-11-28"], ["ID" => "2", "start_date" => "2018-11-22", "end_date" => "2018-11-28"], ["ID" => "3", "start_date" => "2018-11-26", "end_date" => "2018-11-30"], ["ID" => "4", "start_date" => "2018-11-27", "end_date" => "2018-11-31"], ["ID" => "4", "start_date" => "2018-11-29", "end_date" => "2018-11-31"] ] ]; $array["items"] = array_values( array_reduce( $array["items"], function ($carry, $row) { $carry[$row["end_date"]]["data"] = $row["end_date"]; $carry[$row["end_date"]][] = $row; return $carry; } ) ); var_export($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QZSQE
function name:  (null)
number of ops:  16
compiled vars:  !0 = $array
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   14     1        INIT_FCALL                                                   'array_values'
   15     2        INIT_FCALL                                                   'array_reduce'
   16     3        FETCH_DIM_R                                          ~3      !0, 'items'
          4        SEND_VAL                                                     ~3
   17     5        DECLARE_LAMBDA_FUNCTION                              ~4      [0]
   21     6        SEND_VAL                                                     ~4
   15     7        DO_ICALL                                             $5      
   21     8        SEND_VAR                                                     $5
   14     9        DO_ICALL                                             $6      
         10        ASSIGN_DIM                                                   !0, 'items'
   21    11        OP_DATA                                                      $6
   24    12        INIT_FCALL                                                   'var_export'
         13        SEND_VAR                                                     !0
         14        DO_ICALL                                                     
         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/QZSQE
function name:  {closure:/in/QZSQE:17}
number of ops:  13
compiled vars:  !0 = $carry, !1 = $row
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   17     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   18     2        FETCH_DIM_R                                          ~2      !1, 'end_date'
          3        FETCH_DIM_R                                          ~5      !1, 'end_date'
          4        FETCH_DIM_W                                          $3      !0, ~2
          5        ASSIGN_DIM                                                   $3, 'data'
          6        OP_DATA                                                      ~5
   19     7        FETCH_DIM_R                                          ~6      !1, 'end_date'
          8        FETCH_DIM_W                                          $7      !0, ~6
          9        ASSIGN_DIM                                                   $7
         10        OP_DATA                                                      !1
   20    11      > RETURN                                                       !0
   21    12*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.01 ms | 2190 KiB | 16 Q