3v4l.org

run code in 300+ PHP versions simultaneously
<?php # I expected sort() not to be stable on same values, but this? # Using SORT_NUMERIC "fixes" it? $a=array(0,"a"); var_dump($a); sort($a); var_dump($a); sort($a); var_dump($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9Mauu
function name:  (null)
number of ops:  17
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
    5     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    6     4        INIT_FCALL                                               'sort'
          5        SEND_REF                                                 !0
          6        DO_ICALL                                                 
    7     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
    8    10        INIT_FCALL                                               'sort'
         11        SEND_REF                                                 !0
         12        DO_ICALL                                                 
    9    13        INIT_FCALL                                               'var_dump'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.56 ms | 1394 KiB | 17 Q