3v4l.org

run code in 300+ PHP versions simultaneously
<?php $mem_start = memory_get_usage(true); echo 'start: ' . $mem_start . PHP_EOL; $max_iterations = 1000; for ($i = 1; $i <= $max_iterations; $i++) { DateTime::createFromFormat('M/D/Y H:i:s', '2013-11-12 20:00:00'); if (($i % 100) == 0) { echo $i . '.: ' . memory_get_usage(true) . PHP_EOL; } } $mem_end = memory_get_usage(true); echo 'end: ' . $mem_end . PHP_EOL; echo 'diff end-start: ' . ($mem_end - $mem_start) . PHP_EOL;
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.25, 7.3.0 - 7.3.12, 7.4.0
start: 2097152 100.: 2097152 200.: 2097152 300.: 2097152 400.: 2097152 500.: 2097152 600.: 2097152 700.: 2097152 800.: 2097152 900.: 2097152 1000.: 2097152 end: 2097152 diff end-start: 0
Output for 5.4.34 - 5.4.45, 5.5.18 - 5.5.38, 5.6.0 - 5.6.28
start: 262144 100.: 262144 200.: 262144 300.: 262144 400.: 262144 500.: 262144 600.: 262144 700.: 262144 800.: 262144 900.: 262144 1000.: 262144 end: 262144 diff end-start: 0
Output for 5.4.0 - 5.4.32, 5.5.0 - 5.5.16
start: 262144 100.: 262144 200.: 262144 300.: 262144 400.: 262144 500.: 262144 600.: 262144 700.: 524288 800.: 524288 900.: 524288 1000.: 524288 end: 524288 diff end-start: 262144
Output for 5.3.0 - 5.3.29
start: 786432 100.: 786432 200.: 786432 300.: 786432 400.: 786432 500.: 786432 600.: 786432 700.: 786432 800.: 1048576 900.: 1048576 1000.: 1048576 end: 1048576 diff end-start: 262144
Output for 5.2.10 - 5.2.17
start: 262144 Fatal error: Call to undefined method DateTime::createFromFormat() in /in/BUW3T on line 7
Process exited with code 255.
Output for 5.2.1 - 5.2.9
start: 262144 Fatal error: Call to undefined method DateTime::createfromformat() in /in/BUW3T on line 7
Process exited with code 255.
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0
Fatal error: Call to undefined function memory_get_usage() in /in/BUW3T on line 2
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: memory_get_usage() in /in/BUW3T on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
Fatal error: Call to undefined function: memory_get_usage() in /in/BUW3T on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: memory_get_usage() in /in/BUW3T on line 2

preferences:
160.27 ms | 401 KiB | 264 Q