3v4l.org

run code in 300+ PHP versions simultaneously
<?php $current_time = '4:00'; $time_slot = ['1:00','3:00','15:00','19:00']; var_export( array_filter( $time_slot, fn($v) => strnatcmp($current_time, $v) === -1 ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aoZP3
function name:  (null)
number of ops:  12
compiled vars:  !0 = $current_time, !1 = $time_slot
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '4%3A00'
    4     1        ASSIGN                                                   !1, <array>
    5     2        INIT_FCALL                                               'var_export'
    6     3        INIT_FCALL                                               'array_filter'
    7     4        SEND_VAR                                                 !1
    8     5        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
          6        BIND_LEXICAL                                             ~4, !0
    9     7        SEND_VAL                                                 ~4
    6     8        DO_ICALL                                         $5      
    9     9        SEND_VAR                                                 $5
    5    10        DO_ICALL                                                 
   10    11      > 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/aoZP3
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $v, !1 = $current_time
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        INIT_FCALL                                               'strnatcmp'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        IS_IDENTICAL                                     ~3      $2, -1
          7      > RETURN                                                   ~3
    9     8*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
245.38 ms | 1012 KiB | 16 Q