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! 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);
Output for 7.4.0
30391928 END Alive 30391992 Certain death 60395216
Output for 7.3.0 - 7.3.12
30392216 END Alive 30392272 Certain death 60395496
Output for 7.2.0 - 7.2.25
30388104 END Alive 30388160 Certain death 60391384
Output for 7.1.0 - 7.1.33
30351400 END Alive 30351456 Certain death 60354680
Output for 7.0.0 - 7.0.33
30351440 END Alive 30351496 Certain death 60354720
Output for 5.6.0 - 5.6.40
30220264 END Alive 30220344 Certain death 60220520
Output for 5.5.0 - 5.5.38
30220264 END Alive 30220328 Certain death 60220480
Output for 5.4.0 - 5.4.45
30220784 END Alive 30220848 Certain death 60221000
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.0.5, 5.1.0 - 5.1.6, 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.3.11, 4.4.0 - 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

preferences:
179.41 ms | 401 KiB | 322 Q