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)); var_export($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kFp3m
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'
   16     2        INIT_FCALL                                               'usort'
          3        SEND_REF                                                 !0
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FkFp3m%3A16%240'
          5        BIND_LEXICAL                                             ~4, !1
          6        SEND_VAL                                                 ~4
          7        DO_ICALL                                                 
   17     8        INIT_FCALL                                               'var_export'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FkFp3m%3A16%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/kFp3m
function name:  {closure}
number of ops:  15
compiled vars:  !0 = $a, !1 = $b, !2 = $today
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
          3        IS_SMALLER                                       ~3      !2, !0
          4      > JMPZ_EX                                          ~3      ~3, ->7
          5    >   IS_SMALLER                                       ~4      !2, !1
          6        BOOL                                             ~3      ~4
          7    > > JMPZ                                                     ~3, ->10
          8    >   QM_ASSIGN                                        ~5      -1
          9      > JMP                                                      ->11
         10    >   QM_ASSIGN                                        ~5      1
         11    >   SPACESHIP                                        ~6      !0, !1
         12        MUL                                              ~7      ~5, ~6
         13      > RETURN                                                   ~7
         14*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FkFp3m%3A16%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.98 ms | 1402 KiB | 17 Q