3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ 1 => [ 'Date' => '2015-11-05' ], 2 => [ 'Date' => '2015-11-11' ] ]; uksort($arr,'mySortDate'); function mySortDate($a,$b) { $aDate = strtotime($a['Date']); $bDate = strtotime($b['Date']); if ($aDate == $bDate) { return 0; } return ($aDate < $bDate) ? -1 : 1; } print "<pre>"; var_dump($arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OtiGc
function name:  (null)
number of ops:  10
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   13     1        INIT_FCALL                                               'uksort'
          2        SEND_REF                                                 !0
          3        SEND_VAL                                                 'mySortDate'
          4        DO_ICALL                                                 
   26     5        ECHO                                                     '%3Cpre%3E'
   27     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function mysortdate:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 15
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OtiGc
function name:  mySortDate
number of ops:  22
compiled vars:  !0 = $a, !1 = $b, !2 = $aDate, !3 = $bDate
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   17     2        INIT_FCALL                                               'strtotime'
          3        FETCH_DIM_R                                      ~4      !0, 'Date'
          4        SEND_VAL                                                 ~4
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !2, $5
   18     7        INIT_FCALL                                               'strtotime'
          8        FETCH_DIM_R                                      ~7      !1, 'Date'
          9        SEND_VAL                                                 ~7
         10        DO_ICALL                                         $8      
         11        ASSIGN                                                   !3, $8
   20    12        IS_EQUAL                                                 !2, !3
         13      > JMPZ                                                     ~10, ->15
   21    14    > > RETURN                                                   0
   23    15    >   IS_SMALLER                                               !2, !3
         16      > JMPZ                                                     ~11, ->19
         17    >   QM_ASSIGN                                        ~12     -1
         18      > JMP                                                      ->20
         19    >   QM_ASSIGN                                        ~12     1
         20    > > RETURN                                                   ~12
   24    21*     > RETURN                                                   null

End of function mysortdate

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.06 ms | 1396 KiB | 19 Q