3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pr = array( array( 'id' => 'aaa', 'date' => 'Oct 8, 2006' ), array( 'id' => 'bbb', 'date' => 'Nov 14, 2008'), array( 'id' => 'ccc', 'date' => 'Dec 19, 2014'), array( 'id' => 'ddd', 'date' => 'Feb 4, 2010'), array( 'id' => 'eee', 'date' => 'Jul 7, 2013'), array( 'id' => 'fff', 'date' => 'Mar 6, 2002'), array( 'id' => 'ggg', 'date' => 'Mar 1, 2001'), array( 'id' => 'hhh', 'date' => 'Aug 8, 1999'), array( 'id' => 'iii', 'date' => 'Sep 5, 2007'), array( 'id' => 'jjj', 'date' => 'Apr 13, 2004'), array( 'id' => 'kkk', 'date' => 'Mar 6, 1996'), array( 'id' => 'lll', 'date' => 'Mar 6, 1997'), array( 'id' => 'mmm', 'date' => 'Mar 6, 1998'), array( 'id' => 'nnn', 'date' => 'Mar 6, 1999'), array( 'id' => 'ooo', 'date' => 'Mar 7, 1996'), array( 'id' => 'ppp', 'date' => 'Mar 7, 1997'), array( 'id' => 'qqq', 'date' => 'Mar 7, 2002') ); function cmp($a,$b) { return strtotime($a['date']) < strtotime($b['date']); } usort($pr,'cmp'); print_r($pr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7prWJ
function name:  (null)
number of ops:  9
compiled vars:  !0 = $pr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   25     1        INIT_FCALL                                               'usort'
          2        SEND_REF                                                 !0
          3        SEND_VAL                                                 'cmp'
          4        DO_ICALL                                                 
   26     5        INIT_FCALL                                               'print_r'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Function cmp:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7prWJ
function name:  cmp
number of ops:  13
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   23     2        INIT_FCALL                                               'strtotime'
          3        FETCH_DIM_R                                      ~2      !0, 'date'
          4        SEND_VAL                                                 ~2
          5        DO_ICALL                                         $3      
          6        INIT_FCALL                                               'strtotime'
          7        FETCH_DIM_R                                      ~4      !1, 'date'
          8        SEND_VAL                                                 ~4
          9        DO_ICALL                                         $5      
         10        IS_SMALLER                                       ~6      $3, $5
         11      > RETURN                                                   ~6
   24    12*     > RETURN                                                   null

End of function cmp

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
272.76 ms | 1007 KiB | 16 Q