3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array(array("data" => "abcd", "edit" => "1", "day" => "05", "month" => "04", "year" => "2013"), array("data" => "efgh", "edit" => "2", "day" => "07", "month" => "03", "year" => "2013")); function cmp($a, $b) { $date1 = strtotime($a['year'] . "-" . $a['month'] . "-" . $a['day']); $date2 = strtotime($b['year'] . "-" . $b['month'] . "-" . $b['day']); return $date1 - $date2; } usort($array, "cmp"); print_r($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Jm3E1
function name:  (null)
number of ops:  9
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   21     1        INIT_FCALL                                               'usort'
          2        SEND_REF                                                 !0
          3        SEND_VAL                                                 'cmp'
          4        DO_ICALL                                                 
   22     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/Jm3E1
function name:  cmp
number of ops:  27
compiled vars:  !0 = $a, !1 = $b, !2 = $date1, !3 = $date2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   15     2        INIT_FCALL                                               'strtotime'
          3        FETCH_DIM_R                                      ~4      !0, 'year'
          4        CONCAT                                           ~5      ~4, '-'
          5        FETCH_DIM_R                                      ~6      !0, 'month'
          6        CONCAT                                           ~7      ~5, ~6
          7        CONCAT                                           ~8      ~7, '-'
          8        FETCH_DIM_R                                      ~9      !0, 'day'
          9        CONCAT                                           ~10     ~8, ~9
         10        SEND_VAL                                                 ~10
         11        DO_ICALL                                         $11     
         12        ASSIGN                                                   !2, $11
   16    13        INIT_FCALL                                               'strtotime'
         14        FETCH_DIM_R                                      ~13     !1, 'year'
         15        CONCAT                                           ~14     ~13, '-'
         16        FETCH_DIM_R                                      ~15     !1, 'month'
         17        CONCAT                                           ~16     ~14, ~15
         18        CONCAT                                           ~17     ~16, '-'
         19        FETCH_DIM_R                                      ~18     !1, 'day'
         20        CONCAT                                           ~19     ~17, ~18
         21        SEND_VAL                                                 ~19
         22        DO_ICALL                                         $20     
         23        ASSIGN                                                   !3, $20
   18    24        SUB                                              ~22     !2, !3
         25      > RETURN                                                   ~22
   19    26*     > RETURN                                                   null

End of function cmp

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.08 ms | 1401 KiB | 19 Q