3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php ini_set("display_errors","On"); error_reporting(E_ALL); function without($var){ echo "Certain death\n"; $var.='die fucker DIE! ajajajajajajjjkajklsdjklasjdklasd'; echo memory_get_usage(), PHP_EOL; } function with(&$var){ echo "Alive\n"; echo memory_get_usage(), PHP_EOL; } $str = str_repeat('foo', 10000000); echo memory_get_usage(), PHP_EOL; echo "END\n"; with($str); without($str);
based on v386G
Output for 7.1.0
30351472 END Alive 30351528 Certain death 60354752
Output for 7.0.0 - 7.0.14
30351512 END Alive 30351568 Certain death 60354792
Output for hhvm-3.10.0 - 3.12.0
2097152 END Alive 2097152 Certain death 2097152
Output for 5.6.8 - 5.6.28
30220448 END Alive 30220528 Certain death 60220704
Output for 5.5.24 - 5.5.35
30220448 END Alive 30220512 Certain death 60220664
Output for 5.4.34 - 5.4.45
30220968 END Alive 30221032 Certain death 60221184
Output for 5.4.0 - 5.4.32
Warning: ini_set() has been disabled for security reasons in /in/TS415 on line 3 30220880 END Alive 30220912 Certain death 60221064
Output for 5.3.11 - 5.3.29
Warning: ini_set() has been disabled for security reasons in /in/TS415 on line 3 30624160 END Alive 30624160 Certain death 60624280
Output for 5.3.0 - 5.3.10
Warning: ini_set() has been disabled for security reasons in /in/TS415 on line 3 30624024 END Alive 30624024 Certain death 60624144
Output for 5.2.10 - 5.2.17
Warning: ini_set() has been disabled for security reasons in /in/TS415 on line 3 30082712 END Alive 30082976 Certain death 60083088
Output for 5.2.7 - 5.2.9
Warning: ini_set() has been disabled for security reasons in /in/TS415 on line 3 30083648 END Alive 30083912 Certain death 60084080
Output for 5.2.3 - 5.2.6
Warning: ini_set() has been disabled for security reasons in /in/TS415 on line 3 30083800 END Alive 30084064 Certain death 60084232
Output for 5.2.2
Warning: ini_set() has been disabled for security reasons in /in/TS415 on line 3 30081584 END Alive 30081848 Certain death 60082016
Output for 5.2.1
Warning: ini_set() has been disabled for security reasons in /in/TS415 on line 3 30081632 END Alive 30081896 Certain death 60081968
Output for 5.0.0 - 5.2.0
Warning: ini_set() has been disabled for security reasons in /in/TS415 on line 3 Fatal error: Call to undefined function memory_get_usage() in /in/TS415 on line 19
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Warning: ini_set() has been disabled for security reasons in /in/TS415 on line 3 Fatal error: Call to undefined function: memory_get_usage() in /in/TS415 on line 19
Process exited with code 255.
Output for 4.3.5 - 4.4.4
Warning: ini_set() has been disabled for security reasons in /in/TS415 on line 3 Fatal error: Call to undefined function: memory_get_usage() in /in/TS415 on line 19
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Warning: ini_set,pcntl_fork() has been disabled for security reasons in /in/TS415 on line 3 Fatal error: Call to undefined function: memory_get_usage() in /in/TS415 on line 19
Process exited with code 255.
Output for 4.3.1
Warning: ini_set,pcntl_fork() has been disabled for security reasons in /in/TS415 on line 3 Fatal error: Call to undefined function: memory_get_usage() in /in/TS415 on line 19
Output for 4.3.0