3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = [ 124 => [ 'releaseDate' => '2020-07-01 00:00:00', 'isNewest' => true, ], 110 => [ 'releaseDate' => '2020-08-15 00:00:00', 'isNewest' => false, ], 129 => [ 'releaseDate' => '2020-08-15 00:00:00', 'isNewest' => true, ], 128 => [ 'releaseDate' => '2020-08-15 00:00:00', 'isNewest' => false, ], 130 => [ 'releaseDate' => '2020-08-15 00:00:00', 'isNewest' => false, ], 131 => [ 'releaseDate' => '2020-08-15 00:00:00', 'isNewest' => false, ], 132 => [ 'releaseDate' => '2020-08-15 00:00:00', 'isNewest' => false, ], 123 => [ 'releaseDate' => '2020-07-01 00:00:00', 'isNewest' => false, ], 125 => [ 'releaseDate' => '2020-07-01 00:00:00', 'isNewest' => false, ], 127 => [ 'releaseDate' => '2020-07-01 00:00:00', 'isNewest' => false, ], ]; uasort($input, fn($a, $b) => strtotime($b['releaseDate']) - strtotime($a['releaseDate'])); uasort($input, fn($a, $b) => $b['isNewest'] - $a['isNewest']); var_dump($input);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/l4XJH
function name:  (null)
number of ops:  15
compiled vars:  !0 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   46     1        INIT_FCALL                                               'uasort'
          2        SEND_REF                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
          4        SEND_VAL                                                 ~2
          5        DO_ICALL                                                 
   47     6        INIT_FCALL                                               'uasort'
          7        SEND_REF                                                 !0
          8        DECLARE_LAMBDA_FUNCTION                          ~4      [1]
          9        SEND_VAL                                                 ~4
         10        DO_ICALL                                                 
   49    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                                 
         14      > 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/l4XJH
function name:  {closure}
number of ops:  13
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   46     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        INIT_FCALL                                               'strtotime'
          3        FETCH_DIM_R                                      ~2      !1, 'releaseDate'
          4        SEND_VAL                                                 ~2
          5        DO_ICALL                                         $3      
          6        INIT_FCALL                                               'strtotime'
          7        FETCH_DIM_R                                      ~4      !0, 'releaseDate'
          8        SEND_VAL                                                 ~4
          9        DO_ICALL                                         $5      
         10        SUB                                              ~6      $3, $5
         11      > RETURN                                                   ~6
         12*     > RETURN                                                   null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/l4XJH
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   47     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        FETCH_DIM_R                                      ~2      !1, 'isNewest'
          3        FETCH_DIM_R                                      ~3      !0, 'isNewest'
          4        SUB                                              ~4      ~2, ~3
          5      > RETURN                                                   ~4
          6*     > RETURN                                                   null

End of Dynamic Function 1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.2 ms | 1005 KiB | 16 Q