3v4l.org

run code in 300+ PHP versions simultaneously
<?php function sortFunction( $a, $b ) { return strtotime($a["date"]) - strtotime($b["date"]); } $data = json_decode('[{"date":"2013-09-01 00:00:02","content":"1"}, {"date":"2013-09-01 00:00:09","content":"5"}, {"date":"2013-09-01 00:00:01","content":"3"}]'); usort($data, "sortFunction"); var_dump($data);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/26boA
function name:  (null)
number of ops:  12
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'json_decode'
          1        SEND_VAL                                                 '%5B%7B%22date%22%3A%222013-09-01+00%3A00%3A02%22%2C%22content%22%3A%221%22%7D%2C%0A+++++++++++%7B%22date%22%3A%222013-09-01+00%3A00%3A09%22%2C%22content%22%3A%225%22%7D%2C%0A+++++++++++%7B%22date%22%3A%222013-09-01+00%3A00%3A01%22%2C%22content%22%3A%223%22%7D%5D'
          2        DO_ICALL                                         $1      
          3        ASSIGN                                                   !0, $1
   11     4        INIT_FCALL                                               'usort'
          5        SEND_REF                                                 !0
          6        SEND_VAL                                                 'sortFunction'
          7        DO_ICALL                                                 
   12     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Function sortfunction:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/26boA
function name:  sortFunction
number of ops:  13
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     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        SUB                                              ~6      $3, $5
         11      > RETURN                                                   ~6
    5    12*     > RETURN                                                   null

End of function sortfunction

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.85 ms | 1388 KiB | 21 Q