3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = [[ 2 => 9.6 ], [ 497 => 11.666666666667 ], [ 451 => 34 ], [ 459 => 8.8 ], [ 461 => 22.5 ]]; echo 'Before:', PHP_EOL; print_r($array); usort($array, function($a, $b) { return reset($b) <=> reset($a); }); echo 'After:', PHP_EOL; print_r($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uni3v
function name:  (null)
number of ops:  17
compiled vars:  !0 = $array
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   15     1        ECHO                                                         'Before%3A'
          2        ECHO                                                         '%0A'
   16     3        INIT_FCALL                                                   'print_r'
          4        SEND_VAR                                                     !0
          5        DO_ICALL                                                     
   18     6        INIT_FCALL                                                   'usort'
          7        SEND_REF                                                     !0
          8        DECLARE_LAMBDA_FUNCTION                              ~3      [0]
   20     9        SEND_VAL                                                     ~3
   18    10        DO_ICALL                                                     
   22    11        ECHO                                                         'After%3A'
         12        ECHO                                                         '%0A'
   23    13        INIT_FCALL                                                   'print_r'
         14        SEND_VAR                                                     !0
         15        DO_ICALL                                                     
         16      > 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/uni3v
function name:  {closure:/in/uni3v:18}
number of ops:  11
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   19     2        INIT_FCALL                                                   'reset'
          3        SEND_REF                                                     !1
          4        DO_ICALL                                             $2      
          5        INIT_FCALL                                                   'reset'
          6        SEND_REF                                                     !0
          7        DO_ICALL                                             $3      
          8        SPACESHIP                                            ~4      $2, $3
          9      > RETURN                                                       ~4
   20    10*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
167.72 ms | 2753 KiB | 16 Q