3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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";
Output for 7.1.0
346664 347976 346696
Output for 7.0.0 - 7.0.14
346680 347992 346712
Output for 5.6.0 - 5.6.28
217504 219000 217688
Output for 5.5.0 - 5.5.38
217504 218984 217672
Output for 5.4.10 - 5.4.45
218024 219504 218192
Output for 5.4.0 - 5.4.9
217496 218976 217664
Output for 5.3.11 - 5.3.29
621280 622800 621456
Output for 5.3.0 - 5.3.10
620976 622496 621152
Output for 5.2.10 - 5.2.17
79104 80600 79272
Output for 5.2.7 - 5.2.9
79472 116992 115968
Output for 5.2.3 - 5.2.6
79792 117312 116288
Output for 5.2.2
77720 110008 108984
Output for 5.2.1
77720 85544 84520
Output for 5.0.0 - 5.2.0
Fatal error: Call to undefined function memory_get_usage() in /in/u4q4B on line 2
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: memory_get_usage() in /in/u4q4B on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: memory_get_usage() in /in/u4q4B on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: memory_get_usage() in /in/u4q4B on line 2