3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = []; $a = 1; $b = 2; for($x = 0; $x <= 100_000; $x++) $arr[] = [$a, $b]; echo "Current memory usage: " . (memory_get_usage() / 1024) . " KB\n"; echo "Peak memory usage: " . (memory_get_peak_usage() / 1024) . " KB\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 5
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 5
Branch analysis from position: 12
Branch analysis from position: 5
filename:       /in/pETM9
function name:  (null)
number of ops:  25
compiled vars:  !0 = $arr, !1 = $a, !2 = $b, !3 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, 1
    6     2        ASSIGN                                                   !2, 2
    7     3        ASSIGN                                                   !3, 0
          4      > JMP                                                      ->10
          5    >   INIT_ARRAY                                       ~9      !1
          6        ADD_ARRAY_ELEMENT                                ~9      !2
          7        ASSIGN_DIM                                               !0
          8        OP_DATA                                                  ~9
          9        PRE_INC                                                  !3
         10    >   IS_SMALLER_OR_EQUAL                                      !3, 100000
         11      > JMPNZ                                                    ~11, ->5
    9    12    >   INIT_FCALL                                               'memory_get_usage'
         13        DO_ICALL                                         $12     
         14        DIV                                              ~13     $12, 1024
         15        CONCAT                                           ~14     'Current+memory+usage%3A+', ~13
         16        CONCAT                                           ~15     ~14, '+KB%0A'
         17        ECHO                                                     ~15
   10    18        INIT_FCALL                                               'memory_get_peak_usage'
         19        DO_ICALL                                         $16     
         20        DIV                                              ~17     $16, 1024
         21        CONCAT                                           ~18     'Peak+memory+usage%3A+', ~17
         22        CONCAT                                           ~19     ~18, '+KB%0A'
         23        ECHO                                                     ~19
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.02 ms | 1001 KiB | 15 Q