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', 10000000); echo memory_get_usage(), PHP_EOL; echo "END\n"; with($str); without($str);
based on O3eXk
Output for 7.1.0
30351432 END Alive 30351488 Certain death 60354712
Output for 7.0.0 - 7.0.14
30351472 END Alive 30351528 Certain death 60354752
Output for hhvm-3.10.0 - 3.12.0
2097152 END Alive 2097152 Certain death 2097152
Output for 5.6.8 - 5.6.28
30220464 END Alive 30220544 Certain death 60220656
Output for 5.5.24 - 5.5.35
30220464 END Alive 30220528 Certain death 60220640
Output for 5.4.34 - 5.4.45
30220984 END Alive 30221048 Certain death 60221160
Output for 5.4.0 - 5.4.32
Warning: ini_set() has been disabled for security reasons in /in/v386G on line 3 30220880 END Alive 30220912 Certain death 60221024
Output for 5.3.11 - 5.3.29
Warning: ini_set() has been disabled for security reasons in /in/v386G on line 3 30624120 END Alive 30624120 Certain death 60624200
Output for 5.3.0 - 5.3.10
Warning: ini_set() has been disabled for security reasons in /in/v386G on line 3 30623984 END Alive 30623984 Certain death 60624064
Output for 5.2.10 - 5.2.17
Warning: ini_set() has been disabled for security reasons in /in/v386G on line 3 30082672 END Alive 30082936 Certain death 60083008
Output for 5.2.7 - 5.2.9
Warning: ini_set() has been disabled for security reasons in /in/v386G on line 3 30083608 END Alive 30083872 Certain death 60084000
Output for 5.2.3 - 5.2.6
Warning: ini_set() has been disabled for security reasons in /in/v386G on line 3 30083760 END Alive 30084024 Certain death 60084152
Output for 5.2.2
Warning: ini_set() has been disabled for security reasons in /in/v386G on line 3 30081544 END Alive 30081808 Certain death 60081936
Output for 5.2.1
Warning: ini_set() has been disabled for security reasons in /in/v386G on line 3 30081592 END Alive 30081856 Certain death 60081888
Output for 5.0.0 - 5.2.0
Warning: ini_set() has been disabled for security reasons in /in/v386G on line 3 Fatal error: Call to undefined function memory_get_usage() in /in/v386G 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/v386G on line 3 Fatal error: Call to undefined function: memory_get_usage() in /in/v386G 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/v386G on line 3 Fatal error: Call to undefined function: memory_get_usage() in /in/v386G 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/v386G on line 3 Fatal error: Call to undefined function: memory_get_usage() in /in/v386G 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/v386G on line 3 Fatal error: Call to undefined function: memory_get_usage() in /in/v386G on line 19
Output for 4.3.0