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"; echo memory_get_usage(), PHP_EOL; } function with(&$var){ echo "Alive\n"; echo memory_get_usage(), PHP_EOL; } $str = str_repeat('foo', 100000); echo memory_get_usage(), PHP_EOL; echo "END\n"; with($str); without($str);

preferences:
39.97 ms | 402 KiB | 5 Q