3v4l.org

run code in 300+ PHP versions simultaneously
<?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);
Output for 7.2.0
30388104 END Alive 30388160 Certain death 60391384
Output for 7.1.0, 7.1.7
30351432 END Alive 30351488 Certain death 60354712
Output for 7.1.5 - 7.1.6
30351704 END Alive 30351760 Certain death 60354984
Output for 7.0.0 - 7.0.20
30351472 END Alive 30351528 Certain death 60354752
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.0.5, 5.1.0 - 5.1.6, 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.3.11, 4.4.0 - 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

preferences:
147.13 ms | 401 KiB | 174 Q