3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array(array('date'=>'2014-12-01', 'price'=>'123.00'), array('date'=>'2013-12-01', 'price'=>'123.00'), array('date'=>'2014-02-01', 'price'=>'123.00'), array('date'=>'2014-03-01', 'price'=>'123.00')); var_dump($array); function date_compare($a, $b) { $t1 = strtotime($a[$key]); $t2 = strtotime($b[$key]); return $t1 - $t2; } usort($array, 'date_compare'); var_dump($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8uk91
function name:  (null)
number of ops:  12
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   12     4        INIT_FCALL                                               'usort'
          5        SEND_REF                                                 !0
          6        SEND_VAL                                                 'date_compare'
          7        DO_ICALL                                                 
   14     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

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

End of function date_compare

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.24 ms | 1395 KiB | 19 Q