3v4l.org

run code in 300+ PHP versions simultaneously
<?php $memory = memory_get_usage(true); print $memory ."\n"; $keys = array(); for ($i = 0; $i<1000; $i++) { $keys[] = 'pref:keyname:' . rand(1000000, 9999999); } asort($keys); print memory_get_usage(true) - $memory;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 9
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 9
Branch analysis from position: 19
Branch analysis from position: 9
filename:       /in/tljZr
function name:  (null)
number of ops:  28
compiled vars:  !0 = $memory, !1 = $keys, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'memory_get_usage'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $3      
          3        ASSIGN                                                   !0, $3
    4     4        CONCAT                                           ~5      !0, '%0A'
          5        ECHO                                                     ~5
    6     6        ASSIGN                                                   !1, <array>
    7     7        ASSIGN                                                   !2, 0
          8      > JMP                                                      ->17
    8     9    >   INIT_FCALL                                               'rand'
         10        SEND_VAL                                                 1000000
         11        SEND_VAL                                                 9999999
         12        DO_ICALL                                         $9      
         13        CONCAT                                           ~10     'pref%3Akeyname%3A', $9
         14        ASSIGN_DIM                                               !1
         15        OP_DATA                                                  ~10
    7    16        PRE_INC                                                  !2
         17    >   IS_SMALLER                                               !2, 1000
         18      > JMPNZ                                                    ~12, ->9
   10    19    >   INIT_FCALL                                               'asort'
         20        SEND_REF                                                 !1
         21        DO_ICALL                                                 
   11    22        INIT_FCALL                                               'memory_get_usage'
         23        SEND_VAL                                                 <true>
         24        DO_ICALL                                         $14     
         25        SUB                                              ~15     $14, !0
         26        ECHO                                                     ~15
         27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.87 ms | 1395 KiB | 19 Q