3v4l.org

run code in 300+ PHP versions simultaneously
<?php function main() { $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"; } main();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jvj4b
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'main'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

Function main:
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/jvj4b
function name:  main
number of ops:  26
compiled vars:  !0 = $res, !1 = $m, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     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
    5     6        INIT_FCALL                                               'memory_get_usage'
          7        SEND_VAL                                                 <true>
          8        DO_ICALL                                         $5      
          9        ASSIGN                                                   !1, $5
    6    10        ASSIGN                                                   !2, 0
         11      > JMP                                                      ->14
    7    12    >   ASSIGN                                                   !0, <array>
    6    13        PRE_INC                                                  !2
         14    >   IS_SMALLER                                               !2, 10000
         15      > JMPNZ                                                    ~10, ->12
    9    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
   10    25      > RETURN                                                   null

End of function main

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.37 ms | 1398 KiB | 18 Q