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 = $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 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 12
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 12
Branch analysis from position: 17
Branch analysis from position: 12
filename:       /in/E5kE8
function name:  (null)
number of ops:  27
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                                                      ->15
    6    12    >   ADD                                              ~8      !0, <array>
         13        ASSIGN                                                   !0, ~8
    5    14        PRE_INC                                                  !2
         15    >   IS_SMALLER                                               !2, 10000
         16      > JMPNZ                                                    ~11, ->12
    8    17    >   NOP                                                      
         18        FAST_CONCAT                                      ~12     !2, '+operations+of+%24res%2B%3Darray%28%29+eats%3A+'
         19        INIT_FCALL                                               'memory_get_usage'
         20        SEND_VAL                                                 <true>
         21        DO_ICALL                                         $13     
         22        SUB                                              ~14     $13, !1
         23        CONCAT                                           ~15     ~12, ~14
         24        CONCAT                                           ~16     ~15, '%0A'
         25        ECHO                                                     ~16
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.49 ms | 1395 KiB | 17 Q