3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arr = [ ['name' => 'Mathmatics', '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'], ]; usort($arr,function($a,$b){ $dta = DateTime::createFromFormat('h:i:A',substr($a['time'],0,8)); $dtb = DateTime::createFromFormat('h:i:A',substr($b['time'],0,8)); return $dta <=> $dtb; }); print_r($arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Fq9U5
function name:  (null)
number of ops:  10
compiled vars:  !0 = $arr
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    9     1        INIT_FCALL                                                   'usort'
          2        SEND_REF                                                     !0
          3        DECLARE_LAMBDA_FUNCTION                              ~2      [0]
   13     4        SEND_VAL                                                     ~2
    9     5        DO_ICALL                                                     
   15     6        INIT_FCALL                                                   'print_r'
          7        SEND_VAR                                                     !0
          8        DO_ICALL                                                     
          9      > 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/Fq9U5
function name:  {closure:/in/Fq9U5:9}
number of ops:  21
compiled vars:  !0 = $a, !1 = $b, !2 = $dta, !3 = $dtb
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   10     2        INIT_STATIC_METHOD_CALL                                      'DateTime', 'createFromFormat'
          3        SEND_VAL                                                     'h%3Ai%3AA'
          4        FETCH_DIM_R                                          ~4      !0, 'time'
          5        FRAMELESS_ICALL_3                substr              ~5      ~4, 0
          6        OP_DATA                                                      8
          7        SEND_VAL                                                     ~5
          8        DO_FCALL                                          0  $6      
          9        ASSIGN                                                       !2, $6
   11    10        INIT_STATIC_METHOD_CALL                                      'DateTime', 'createFromFormat'
         11        SEND_VAL                                                     'h%3Ai%3AA'
         12        FETCH_DIM_R                                          ~8      !1, 'time'
         13        FRAMELESS_ICALL_3                substr              ~9      ~8, 0
         14        OP_DATA                                                      8
         15        SEND_VAL                                                     ~9
         16        DO_FCALL                                          0  $10     
         17        ASSIGN                                                       !3, $10
   12    18        SPACESHIP                                            ~12     !2, !3
         19      > RETURN                                                       ~12
   13    20*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
159.53 ms | 1929 KiB | 15 Q