3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo memory_get_usage()."\n"; $x = '.'; $a = ''; for ($i=0;$i<1000;$i++) $a = "$a$x"; echo memory_get_usage()."\n"; unset($a,$x); echo memory_get_usage()."\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 8
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 8
Branch analysis from position: 14
Branch analysis from position: 8
filename:       /in/u4q4B
function name:  (null)
number of ops:  25
compiled vars:  !0 = $x, !1 = $a, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'memory_get_usage'
          1        DO_ICALL                                         $3      
          2        CONCAT                                           ~4      $3, '%0A'
          3        ECHO                                                     ~4
    3     4        ASSIGN                                                   !0, '.'
    4     5        ASSIGN                                                   !1, ''
    5     6        ASSIGN                                                   !2, 0
          7      > JMP                                                      ->12
    6     8    >   NOP                                                      
          9        FAST_CONCAT                                      ~8      !1, !0
         10        ASSIGN                                                   !1, ~8
    5    11        PRE_INC                                                  !2
         12    >   IS_SMALLER                                               !2, 1000
         13      > JMPNZ                                                    ~11, ->8
    8    14    >   INIT_FCALL                                               'memory_get_usage'
         15        DO_ICALL                                         $12     
         16        CONCAT                                           ~13     $12, '%0A'
         17        ECHO                                                     ~13
    9    18        UNSET_CV                                                 !1
         19        UNSET_CV                                                 !0
   10    20        INIT_FCALL                                               'memory_get_usage'
         21        DO_ICALL                                         $14     
         22        CONCAT                                           ~15     $14, '%0A'
         23        ECHO                                                     ~15
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.33 ms | 1395 KiB | 15 Q