3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( "0"=>array("0"=>"joe", "1"=>"2018-07-18 09:00:00"), "1"=>array("0"=>"tom", "1"=>"2018-07-17 09:00:00"), "2"=>array("0"=>"joe", "1"=>"2018-07-14 09:00:00"), "3"=>array("0"=>"sam", "1"=>"2018-07-19 09:00:00"), ); usort($arr, function($a, $b) { return $a[1] <=> $b[1]; }); $joes = array_intersect(array_column($arr, 0), ["joe"]); $current = max(array_keys($joes)); Unset($arr[$current]); Var_dump($arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mah6K
function name:  (null)
number of ops:  27
compiled vars:  !0 = $arr, !1 = $joes, !2 = $current
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   11     1        INIT_FCALL                                               'usort'
          2        SEND_REF                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fmah6K%3A11%240'
   13     4        SEND_VAL                                                 ~4
          5        DO_ICALL                                                 
   15     6        INIT_FCALL                                               'array_intersect'
          7        INIT_FCALL                                               'array_column'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 0
         10        DO_ICALL                                         $6      
         11        SEND_VAR                                                 $6
         12        SEND_VAL                                                 <array>
         13        DO_ICALL                                         $7      
         14        ASSIGN                                                   !1, $7
   17    15        INIT_FCALL                                               'max'
         16        INIT_FCALL                                               'array_keys'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                         $9      
         19        SEND_VAR                                                 $9
         20        DO_ICALL                                         $10     
         21        ASSIGN                                                   !2, $10
   18    22        UNSET_DIM                                                !0, !2
   20    23        INIT_FCALL                                               'var_dump'
         24        SEND_VAR                                                 !0
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fmah6K%3A11%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mah6K
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   12     2        FETCH_DIM_R                                      ~2      !0, 1
          3        FETCH_DIM_R                                      ~3      !1, 1
          4        SPACESHIP                                        ~4      ~2, ~3
          5      > RETURN                                                   ~4
   13     6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fmah6K%3A11%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.21 ms | 1407 KiB | 25 Q