3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = 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[0]['year'] . "-" . $a[0]['month'] . "-" . $a[0]['day']); $date2 = strtotime($b[0]['year'] . "-" . $b[0]['month'] . "-" . $b[0]['day']); return $date1 - $date2; } usort($a, "cmp"); print_r($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/G7hlt
function name:  (null)
number of ops:  9
compiled vars:  !0 = $a
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/G7hlt
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_FCALL                                               'strtotime'
          3        FETCH_DIM_R                                      ~4      !0, 0
          4        FETCH_DIM_R                                      ~5      ~4, 'year'
          5        CONCAT                                           ~6      ~5, '-'
          6        FETCH_DIM_R                                      ~7      !0, 0
          7        FETCH_DIM_R                                      ~8      ~7, 'month'
          8        CONCAT                                           ~9      ~6, ~8
          9        CONCAT                                           ~10     ~9, '-'
         10        FETCH_DIM_R                                      ~11     !0, 0
         11        FETCH_DIM_R                                      ~12     ~11, 'day'
         12        CONCAT                                           ~13     ~10, ~12
         13        SEND_VAL                                                 ~13
         14        DO_ICALL                                         $14     
         15        ASSIGN                                                   !2, $14
   16    16        INIT_FCALL                                               'strtotime'
         17        FETCH_DIM_R                                      ~16     !1, 0
         18        FETCH_DIM_R                                      ~17     ~16, 'year'
         19        CONCAT                                           ~18     ~17, '-'
         20        FETCH_DIM_R                                      ~19     !1, 0
         21        FETCH_DIM_R                                      ~20     ~19, 'month'
         22        CONCAT                                           ~21     ~18, ~20
         23        CONCAT                                           ~22     ~21, '-'
         24        FETCH_DIM_R                                      ~23     !1, 0
         25        FETCH_DIM_R                                      ~24     ~23, 'day'
         26        CONCAT                                           ~25     ~22, ~24
         27        SEND_VAL                                                 ~25
         28        DO_ICALL                                         $26     
         29        ASSIGN                                                   !3, $26
   18    30        SUB                                              ~28     !2, !3
         31      > RETURN                                                   ~28
   19    32*     > RETURN                                                   null

End of function cmp

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.47 ms | 1400 KiB | 19 Q