3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = [ ['array-5', 0], ['array-7', -.5], ['array-4', 0], ['array-1',-1], ['array-3', 2], ['array-6', .5], ['array-2', 3], ['array-8', -2] ]; usort( $array, fn($a, $b) => ($b[1] < 0 <=> $a[1] < 0) ?: (abs($b[1]) <=> abs($a[1])) ); var_export($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9qXnA
function name:  (null)
number of ops:  10
compiled vars:  !0 = $array
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   14     1        INIT_FCALL                                                   'usort'
   15     2        SEND_REF                                                     !0
   16     3        DECLARE_LAMBDA_FUNCTION                              ~2      [0]
   18     4        SEND_VAL                                                     ~2
   14     5        DO_ICALL                                                     
   19     6        INIT_FCALL                                                   'var_export'
          7        SEND_VAR                                                     !0
          8        DO_ICALL                                                     
          9      > 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/9qXnA
function name:  {closure:/in/9qXnA:16}
number of ops:  20
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        FETCH_DIM_R                                          ~2      !1, 1
          3        IS_SMALLER                                           ~3      ~2, 0
          4        FETCH_DIM_R                                          ~4      !0, 1
          5        IS_SMALLER                                           ~5      ~4, 0
          6        SPACESHIP                                            ~6      ~3, ~5
          7        JMP_SET                                              ~7      ~6, ->18
   17     8        INIT_FCALL                                                   'abs'
          9        FETCH_DIM_R                                          ~8      !1, 1
         10        SEND_VAL                                                     ~8
         11        DO_ICALL                                             $9      
         12        INIT_FCALL                                                   'abs'
         13        FETCH_DIM_R                                          ~10     !0, 1
         14        SEND_VAL                                                     ~10
         15        DO_ICALL                                             $11     
         16        SPACESHIP                                            ~12     $9, $11
         17        QM_ASSIGN                                            ~7      ~12
         18      > RETURN                                                       ~7
   18    19*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
165.64 ms | 1788 KiB | 15 Q