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!'; echo memory_get_usage(), PHP_EOL; } function with(&$var){ echo "Alive\n"; echo memory_get_usage(), PHP_EOL; } $str = str_repeat('foo', 1000000); echo memory_get_usage(), PHP_EOL; echo "END\n"; without($str); with($str);
based on HWkW4
Output for 7.1.0
3350600 END Certain death 6353024 Alive 3350656
Output for 7.0.0 - 7.0.14
3350640 END Certain death 6353064 Alive 3350696
Output for hhvm-3.10.0 - 3.12.0
2097152 END Certain death 2097152 Alive 2097152
Output for 5.6.7 - 5.6.28
3220464 END Certain death 6220624 Alive 3220576
Output for 5.5.24 - 5.5.35
3220464 END Certain death 6220608 Alive 3220560
Output for 5.4.34 - 5.4.45
3220984 END Certain death 6221128 Alive 3221080
Output for 5.4.0 - 5.4.32
Warning: ini_set() has been disabled for security reasons in /in/O3eXk on line 3 3220880 END Certain death 6220992 Alive 3220944
Output for 5.3.11 - 5.3.29
Warning: ini_set() has been disabled for security reasons in /in/O3eXk on line 3 3624120 END Certain death 6624200 Alive 3624120
Output for 5.3.0 - 5.3.10
Warning: ini_set() has been disabled for security reasons in /in/O3eXk on line 3 3623984 END Certain death 6624064 Alive 3623984
Output for 5.2.10 - 5.2.17
Warning: ini_set() has been disabled for security reasons in /in/O3eXk on line 3 3082672 END Certain death 6083008 Alive 3082936
Output for 5.2.7 - 5.2.9
Warning: ini_set() has been disabled for security reasons in /in/O3eXk on line 3 3083608 END Certain death 6083904 Alive 3083968
Output for 5.2.3 - 5.2.6
Warning: ini_set() has been disabled for security reasons in /in/O3eXk on line 3 3083760 END Certain death 6084056 Alive 3084120
Output for 5.2.2
Warning: ini_set() has been disabled for security reasons in /in/O3eXk on line 3 3081544 END Certain death 6081840 Alive 3081904
Output for 5.2.1
Warning: ini_set() has been disabled for security reasons in /in/O3eXk on line 3 3081592 END Certain death 6081888 Alive 3081896
Output for 5.0.0 - 5.2.0
Warning: ini_set() has been disabled for security reasons in /in/O3eXk on line 3 Fatal error: Call to undefined function memory_get_usage() in /in/O3eXk 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/O3eXk on line 3 Fatal error: Call to undefined function: memory_get_usage() in /in/O3eXk 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/O3eXk on line 3 Fatal error: Call to undefined function: memory_get_usage() in /in/O3eXk 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/O3eXk on line 3 Fatal error: Call to undefined function: memory_get_usage() in /in/O3eXk 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/O3eXk on line 3 Fatal error: Call to undefined function: memory_get_usage() in /in/O3eXk on line 19
Output for 4.3.0