3v4l.org

run code in 300+ PHP versions simultaneously
<?php $res = array_fill(0, 100, array()); $m = memory_get_usage(true); for ($i = 0; $i < 10000; $i++) { $res+=array(); } echo "$i operations of \$res+=array() eats: " . (memory_get_usage(true) - $m) . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 12
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 12
Branch analysis from position: 16
Branch analysis from position: 12
filename:       /in/64TZi
function name:  (null)
number of ops:  26
compiled vars:  !0 = $res, !1 = $m, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'array_fill'
          1        SEND_VAL                                                 0
          2        SEND_VAL                                                 100
          3        SEND_VAL                                                 <array>
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !0, $3
    4     6        INIT_FCALL                                               'memory_get_usage'
          7        SEND_VAL                                                 <true>
          8        DO_ICALL                                         $5      
          9        ASSIGN                                                   !1, $5
    5    10        ASSIGN                                                   !2, 0
         11      > JMP                                                      ->14
    6    12    >   ASSIGN_OP                                     1          !0, <array>
    5    13        PRE_INC                                                  !2
         14    >   IS_SMALLER                                               !2, 10000
         15      > JMPNZ                                                    ~10, ->12
    8    16    >   NOP                                                      
         17        FAST_CONCAT                                      ~11     !2, '+operations+of+%24res%2B%3Darray%28%29+eats%3A+'
         18        INIT_FCALL                                               'memory_get_usage'
         19        SEND_VAL                                                 <true>
         20        DO_ICALL                                         $12     
         21        SUB                                              ~13     $12, !1
         22        CONCAT                                           ~14     ~11, ~13
         23        CONCAT                                           ~15     ~14, '%0A'
         24        ECHO                                                     ~15
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
131.8 ms | 1400 KiB | 17 Q