3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dates = ['20-05-2015', '02-01-2015', '30-03-2015', '10-01-1990']; usort($dates, fn($a, $b) => strtotime($a) <=> strtotime($b)); printf( "Latest Date: %s\nEarliest Date: %s", $dates[array_key_last($dates)], $dates[0] );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/O2CiW
function name:  (null)
number of ops:  17
compiled vars:  !0 = $dates
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'usort'
          2        SEND_REF                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
          4        SEND_VAL                                                 ~2
          5        DO_ICALL                                                 
    6     6        INIT_FCALL                                               'printf'
    7     7        SEND_VAL                                                 'Latest+Date%3A+%25s%0AEarliest+Date%3A+%25s'
    8     8        INIT_FCALL                                               'array_key_last'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $4      
         11        FETCH_DIM_R                                      ~5      !0, $4
         12        SEND_VAL                                                 ~5
    9    13        FETCH_DIM_R                                      ~6      !0, 0
         14        SEND_VAL                                                 ~6
    6    15        DO_ICALL                                                 
   10    16      > 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/O2CiW
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        INIT_FCALL                                               'strtotime'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $2      
          5        INIT_FCALL                                               'strtotime'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $3      
          8        SPACESHIP                                        ~4      $2, $3
          9      > RETURN                                                   ~4
         10*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.38 ms | 1006 KiB | 17 Q