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 = DateTime::createFromFormat("d/m/Y", $a["day"].'/'.$a["month"].'/'.$a["year"]); $date2 = DateTime::createFromFormat("d/m/Y", $b["day"].'/'.$b["month"].'/'.$b["year"]); return $date1->getTimestamp() - $date2->getTimestamp(); } usort($array, "cmp"); print_r($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rjvGW
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/rjvGW
function name:  cmp
number of ops:  33
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_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
          3        SEND_VAL                                                 'd%2Fm%2FY'
          4        FETCH_DIM_R                                      ~4      !0, 'day'
          5        CONCAT                                           ~5      ~4, '%2F'
          6        FETCH_DIM_R                                      ~6      !0, 'month'
          7        CONCAT                                           ~7      ~5, ~6
          8        CONCAT                                           ~8      ~7, '%2F'
          9        FETCH_DIM_R                                      ~9      !0, 'year'
         10        CONCAT                                           ~10     ~8, ~9
         11        SEND_VAL                                                 ~10
         12        DO_FCALL                                      0  $11     
         13        ASSIGN                                                   !2, $11
   16    14        INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
         15        SEND_VAL                                                 'd%2Fm%2FY'
         16        FETCH_DIM_R                                      ~13     !1, 'day'
         17        CONCAT                                           ~14     ~13, '%2F'
         18        FETCH_DIM_R                                      ~15     !1, 'month'
         19        CONCAT                                           ~16     ~14, ~15
         20        CONCAT                                           ~17     ~16, '%2F'
         21        FETCH_DIM_R                                      ~18     !1, 'year'
         22        CONCAT                                           ~19     ~17, ~18
         23        SEND_VAL                                                 ~19
         24        DO_FCALL                                      0  $20     
         25        ASSIGN                                                   !3, $20
   18    26        INIT_METHOD_CALL                                         !2, 'getTimestamp'
         27        DO_FCALL                                      0  $22     
         28        INIT_METHOD_CALL                                         !3, 'getTimestamp'
         29        DO_FCALL                                      0  $23     
         30        SUB                                              ~24     $22, $23
         31      > RETURN                                                   ~24
   19    32*     > RETURN                                                   null

End of function cmp

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.86 ms | 946 KiB | 18 Q