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);
Output for 7.4.0
691664 END Alive 691728 Certain death 691728
Output for 7.3.0 - 7.3.12
691952 END Alive 692008 Certain death 692008
Output for 7.2.0 - 7.2.25
687856 END Alive 687912 Certain death 687912
Output for 7.1.0 - 7.1.33
651152 END Alive 651208 Certain death 651208
Output for 7.0.0 - 7.0.33
651192 END Alive 651248 Certain death 651248
Output for 5.6.0 - 5.6.40
520192 END Alive 520272 Certain death 520304
Output for 5.5.0 - 5.5.38
520184 END Alive 520248 Certain death 520280
Output for 5.4.0 - 5.4.45
520704 END Alive 520768 Certain death 520800
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.0.5, 5.1.0 - 5.1.6, 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.3.11, 4.4.0 - 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

preferences:
259.65 ms | 401 KiB | 322 Q