3v4l.org

run code in 300+ PHP versions simultaneously
<?php $props = [ ['name' => 'Mathematics', 'time' => '03:01:PM - 04:50:PM'], ['name' => 'History', 'time' => '11:30:AM - 01:30:PM'], ['name' => 'French', 'time' => '01:31:PM - 03:00:PM'], ]; $times = preg_replace( '~^(\d\d):(\d\d):(AM|PM) - .*$~', '\3\1\2', array_column($props, 'time') ); array_multisort($times, $props); print_r($props);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uOf06
function name:  (null)
number of ops:  19
compiled vars:  !0 = $props, !1 = $times
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        INIT_FCALL                                               'preg_replace'
   10     2        SEND_VAL                                                 '%7E%5E%28%5Cd%5Cd%29%3A%28%5Cd%5Cd%29%3A%28AM%7CPM%29+-+.%2A%24%7E'
   11     3        SEND_VAL                                                 '%5C3%5C1%5C2'
   12     4        INIT_FCALL                                               'array_column'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 'time'
          7        DO_ICALL                                         $3      
          8        SEND_VAR                                                 $3
          9        DO_ICALL                                         $4      
    9    10        ASSIGN                                                   !1, $4
   15    11        INIT_FCALL                                               'array_multisort'
         12        SEND_REF                                                 !1
         13        SEND_REF                                                 !0
         14        DO_ICALL                                                 
   17    15        INIT_FCALL                                               'print_r'
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
126.41 ms | 1399 KiB | 21 Q