3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php 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; $var.="FUCK!"; } $str = str_repeat('foo', 10000000); echo memory_get_usage(), PHP_EOL; echo "END\n"; with($str); without($str);
based on 3JRHf
Output for 7.1.0
30351312 END Alive 30351368 Certain death 60354592
Output for 7.0.0 - 7.0.14
30351352 END Alive 30351408 Certain death 60354632
Output for hhvm-3.10.0 - 3.12.0
2097152 END Alive 2097152 Certain death 2097152
Output for 5.6.7 - 5.6.28
30220168 END Alive 30220248 Certain death 60220400
Output for 5.5.24 - 5.5.35
30220168 END Alive 30220232 Certain death 60220384
Output for 5.4.10 - 5.4.45
30220680 END Alive 30220744 Certain death 60220896
Output for 5.4.0 - 5.4.9
30220664 END Alive 30220728 Certain death 60220880
Output for 5.3.11 - 5.3.29
30623824 END Alive 30623856 Certain death 60623976
Output for 5.3.0 - 5.3.10
30623688 END Alive 30623720 Certain death 60623840
Output for 5.2.10 - 5.2.17
30082376 END Alive 30082672 Certain death 60082784
Output for 5.2.7 - 5.2.9
30083008 END Alive 30083312 Certain death 60083480
Output for 5.2.3 - 5.2.6
30083160 END Alive 30083464 Certain death 60083632
Output for 5.2.2
30081056 END Alive 30081320 Certain death 60081488
Output for 5.2.1
30081104 END Alive 30081368 Certain death 60081440
Output for 5.0.0 - 5.2.0
Fatal error: Call to undefined function memory_get_usage() in /in/4GHpN on line 19
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: memory_get_usage() in /in/4GHpN on line 19
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: memory_get_usage() in /in/4GHpN on line 19
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: memory_get_usage() in /in/4GHpN on line 19