3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ '2022-06-30', '2022-04-20', '2021-04-07', '2022-09-09', '2022-03-08', '2022-06-02', '2021-08-07', '2022-10-12' ]; $today = '2022-06-02'; // date('Y-m-d'); //usort($array, fn($a, $b) => ($a > $today && $b > $today ? -1 : 1) * ($a <=> $b)); usort($array, fn($a, $b) => (min($a, $b) > $today ? -1 : 1) * ($a <=> $b)); var_export($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Wb3CJ
function name:  (null)
number of ops:  12
compiled vars:  !0 = $array, !1 = $today
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   14     1        ASSIGN                                                   !1, '2022-06-02'
   17     2        INIT_FCALL                                               'usort'
          3        SEND_REF                                                 !0
          4        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
          5        BIND_LEXICAL                                             ~4, !1
          6        SEND_VAL                                                 ~4
          7        DO_ICALL                                                 
   18     8        INIT_FCALL                                               'var_export'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
         11      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Wb3CJ
function name:  {closure}
number of ops:  16
compiled vars:  !0 = $a, !1 = $b, !2 = $today
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
          3        INIT_FCALL                                               'min'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $3      
          7        IS_SMALLER                                               !2, $3
          8      > JMPZ                                                     ~4, ->11
          9    >   QM_ASSIGN                                        ~5      -1
         10      > JMP                                                      ->12
         11    >   QM_ASSIGN                                        ~5      1
         12    >   SPACESHIP                                        ~6      !0, !1
         13        MUL                                              ~7      ~5, ~6
         14      > RETURN                                                   ~7
         15*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
274.96 ms | 1008 KiB | 16 Q