3v4l.org

run code in 300+ PHP versions simultaneously
<?php $edge_lengths = [420, 593.9696961967, 420]; uksort($edge_lengths, function($k1, $k2) use ($edge_lengths) { $res = $edge_lengths[$k2] <=> $edge_lengths[$k1]; if ($res) return $res; return $k2 <=> $k1; }); print_r(array_keys($edge_lengths));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/696Sc
function name:  (null)
number of ops:  14
compiled vars:  !0 = $edge_lengths
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        INIT_FCALL                                               'uksort'
          2        SEND_REF                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
          4        BIND_LEXICAL                                             ~2, !0
    9     5        SEND_VAL                                                 ~2
    5     6        DO_ICALL                                                 
   11     7        INIT_FCALL                                               'print_r'
          8        INIT_FCALL                                               'array_keys'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $4      
         11        SEND_VAR                                                 $4
         12        DO_ICALL                                                 
         13      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/696Sc
function name:  {closure}
number of ops:  12
compiled vars:  !0 = $k1, !1 = $k2, !2 = $edge_lengths, !3 = $res
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
    6     3        FETCH_DIM_R                                      ~4      !2, !1
          4        FETCH_DIM_R                                      ~5      !2, !0
          5        SPACESHIP                                        ~6      ~4, ~5
          6        ASSIGN                                                   !3, ~6
    7     7      > JMPZ                                                     !3, ->9
          8    > > RETURN                                                   !3
    8     9    >   SPACESHIP                                        ~8      !1, !0
         10      > RETURN                                                   ~8
    9    11*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.14 ms | 1013 KiB | 16 Q