3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.38 ms | 1388 KiB | 19 Q