3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array ( '_fc1' => array ( 'week_day' => 0, 'hours_start' => '13:30:00', 'hours_end' => '17:30:00', ), '_fc2' => array ( 'week_day' => 1, 'hours_start' => '17:0:00', 'hours_end' => '19:30:00', ), '_fc3' => array ( 'week_day' => 2, 'hours_start' => '16:30:00', 'hours_end' => '20:0:00', ), '_fc4' => array ( 'week_day' => 4, 'hours_start' => '12:0:00', 'hours_end' => '17:30:00', ), ); $newArr = array(); foreach($arr as $val) { $newArr[$val['week_day'].$val['hours_start']] = $val; } rsort($newArr); echo print_r($newArr,1);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 10
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 10
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/DVhFf
function name:  (null)
number of ops:  20
compiled vars:  !0 = $arr, !1 = $newArr, !2 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
    6     1        ASSIGN                                                   !1, <array>
    7     2      > FE_RESET_R                                       $5      !0, ->10
          3    > > FE_FETCH_R                                               $5, !2, ->10
    8     4    >   FETCH_DIM_R                                      ~6      !2, 'week_day'
          5        FETCH_DIM_R                                      ~7      !2, 'hours_start'
          6        CONCAT                                           ~8      ~6, ~7
          7        ASSIGN_DIM                                               !1, ~8
          8        OP_DATA                                                  !2
    7     9      > JMP                                                      ->3
         10    >   FE_FREE                                                  $5
   12    11        INIT_FCALL                                               'rsort'
         12        SEND_REF                                                 !1
         13        DO_ICALL                                                 
   14    14        INIT_FCALL                                               'print_r'
         15        SEND_VAR                                                 !1
         16        SEND_VAL                                                 1
         17        DO_ICALL                                         $11     
         18        ECHO                                                     $11
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.38 ms | 1386 KiB | 17 Q