3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array ( 0 => array ( 0 => array ( 'personNum' => 2, 'type' => 'comment', 'datetime' => '2019-05-15 11:29:45' ), 1 => array ( 'personNum' => 3, 'type' => 'status', 'datetime' => '2019-05-26 15:59:53' ) ), 1 => array ( 0 => array ( 'personNum' => 3, 'type' => 'status', 'datetime' => '2019-05-26 15:59:53' ), 1 => array ( 'personNum' => 4, 'type' => 'status', 'datetime' => '2019-05-26 16:04:24' ), ) ); array_walk($arr, function (&$v) { array_multisort(array_column($v, 'datetime'), SORT_DESC, $v); }); usort($arr, function ($a, $b) { return strcmp(max(array_column($b, 'datetime')), max(array_column($a, 'datetime'))); }); print_r($arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/suPr4
function name:  (null)
number of ops:  15
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   36     1        INIT_FCALL                                               'array_walk'
          2        SEND_REF                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
          4        SEND_VAL                                                 ~2
          5        DO_ICALL                                                 
   37     6        INIT_FCALL                                               'usort'
          7        SEND_REF                                                 !0
          8        DECLARE_LAMBDA_FUNCTION                          ~4      [1]
   39     9        SEND_VAL                                                 ~4
   37    10        DO_ICALL                                                 
   40    11        INIT_FCALL                                               'print_r'
         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/suPr4
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'array_multisort'
          2        INIT_FCALL                                               'array_column'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 'datetime'
          5        DO_ICALL                                         $1      
          6        SEND_VAL                                                 $1
          7        SEND_VAL                                                 3
          8        SEND_REF                                                 !0
          9        DO_ICALL                                                 
         10      > 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/suPr4
function name:  {closure}
number of ops:  22
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   37     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   38     2        INIT_FCALL                                               'strcmp'
          3        INIT_FCALL                                               'max'
          4        INIT_FCALL                                               'array_column'
          5        SEND_VAR                                                 !1
          6        SEND_VAL                                                 'datetime'
          7        DO_ICALL                                         $2      
          8        SEND_VAR                                                 $2
          9        DO_ICALL                                         $3      
         10        SEND_VAR                                                 $3
         11        INIT_FCALL                                               'max'
         12        INIT_FCALL                                               'array_column'
         13        SEND_VAR                                                 !0
         14        SEND_VAL                                                 'datetime'
         15        DO_ICALL                                         $4      
         16        SEND_VAR                                                 $4
         17        DO_ICALL                                         $5      
         18        SEND_VAR                                                 $5
         19        DO_ICALL                                         $6      
         20      > RETURN                                                   $6
   39    21*     > RETURN                                                   null

End of Dynamic Function 1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.57 ms | 1013 KiB | 20 Q