3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ 0 => ['name' => 'aaa', 'date' => '2016-10-02'], 1 => ['name' => 'aaa', 'date' => '2016-10-08'], 2 => ['name' => 'aaa', 'date' => '2016-10-01'], 3 => ['name' => 'aaa', 'date' => '2016-10-02'], 4 => ['name' => 'aaa', 'date' => '2016-10-03'], 5 => ['name' => 'aaa', 'date' => '2016-10-02'], 6 => ['name' => 'aaa', 'date' => '2016-10-05'], 7 => ['name' => 'aaa', 'date' => '2016-10-07'], 8 => ['name' => 'aaa', 'date' => '2016-10-06'], 9 => ['name' => 'aaa', 'date' => '2016-10-04'], ]; usort($arr, function($a, $b){ $dtA = DateTime::createFromFormat('Y-m-d', $a['date'] ); $dtB = DateTime::createFromFormat('Y-m-d', $b['date'] ); return $dtA <=> $dtB; }); var_dump($arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VgTNi
function name:  (null)
number of ops:  10
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   16     1        INIT_FCALL                                               'usort'
          2        SEND_REF                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
   20     4        SEND_VAL                                                 ~2
   16     5        DO_ICALL                                                 
   22     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
          9      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VgTNi
function name:  {closure}
number of ops:  17
compiled vars:  !0 = $a, !1 = $b, !2 = $dtA, !3 = $dtB
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   17     2        INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
          3        SEND_VAL                                                 'Y-m-d'
          4        FETCH_DIM_R                                      ~4      !0, 'date'
          5        SEND_VAL                                                 ~4
          6        DO_FCALL                                      0  $5      
          7        ASSIGN                                                   !2, $5
   18     8        INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
          9        SEND_VAL                                                 'Y-m-d'
         10        FETCH_DIM_R                                      ~7      !1, 'date'
         11        SEND_VAL                                                 ~7
         12        DO_FCALL                                      0  $8      
         13        ASSIGN                                                   !3, $8
   19    14        SPACESHIP                                        ~10     !2, !3
         15      > RETURN                                                   ~10
   20    16*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.7 ms | 1012 KiB | 15 Q