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"; 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);
Output for 7.1.0
651224 END Alive 651280 Certain death 651280
Output for 7.0.0 - 7.0.14
651264 END Alive 651320 Certain death 651320
Output for 5.6.7 - 5.6.28
520376 END Alive 520456 Certain death 520488
Output for 5.5.24 - 5.5.35
520368 END Alive 520432 Certain death 520464
Output for 5.4.34 - 5.4.45
520888 END Alive 520952 Certain death 520984
Output for 5.4.0 - 5.4.32
Warning: ini_set() has been disabled for security reasons in /in/6U7Os on line 3 520792 END Alive 520824 Certain death 520856
Output for 5.3.11 - 5.3.29
Warning: ini_set() has been disabled for security reasons in /in/6U7Os on line 3 923968 END Alive 923968 Certain death 923968
Output for 5.3.0 - 5.3.10
Warning: ini_set() has been disabled for security reasons in /in/6U7Os on line 3 923832 END Alive 923832 Certain death 923832
Output for 5.2.10 - 5.2.17
Warning: ini_set() has been disabled for security reasons in /in/6U7Os on line 3 382520 END Alive 382784 Certain death 382784
Output for 5.2.7 - 5.2.9
Warning: ini_set() has been disabled for security reasons in /in/6U7Os on line 3 383456 END Alive 383720 Certain death 383816
Output for 5.2.3 - 5.2.6
Warning: ini_set() has been disabled for security reasons in /in/6U7Os on line 3 383608 END Alive 383872 Certain death 383968
Output for 5.2.2
Warning: ini_set() has been disabled for security reasons in /in/6U7Os on line 3 381392 END Alive 381656 Certain death 381752
Output for 5.2.1
Warning: ini_set() has been disabled for security reasons in /in/6U7Os on line 3 381440 END Alive 381704 Certain death 381704
Output for 5.0.0 - 5.2.0
Warning: ini_set() has been disabled for security reasons in /in/6U7Os on line 3 Fatal error: Call to undefined function memory_get_usage() in /in/6U7Os on line 18
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Warning: ini_set() has been disabled for security reasons in /in/6U7Os on line 3 Fatal error: Call to undefined function: memory_get_usage() in /in/6U7Os on line 18
Process exited with code 255.
Output for 4.3.5 - 4.4.4
Warning: ini_set() has been disabled for security reasons in /in/6U7Os on line 3 Fatal error: Call to undefined function: memory_get_usage() in /in/6U7Os on line 18
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/6U7Os on line 3 Fatal error: Call to undefined function: memory_get_usage() in /in/6U7Os on line 18
Process exited with code 255.
Output for 4.3.1
Warning: ini_set,pcntl_fork() has been disabled for security reasons in /in/6U7Os on line 3 Fatal error: Call to undefined function: memory_get_usage() in /in/6U7Os on line 18
Output for 4.3.0