3v4l.org

run code in 300+ PHP versions simultaneously
<?php function myfunction($array){var_dump(memory_get_usage());} $array = range(1,1000000); var_dump(memory_get_usage()); myfunction($array);
Output for 7.2.0
int(33941792) int(33941824)
Output for 7.0.0 - 7.0.20, 7.1.0, 7.1.7
int(33905088) int(33905120)
Output for 7.1.5 - 7.1.6
int(33905304) int(33905336)
Output for 5.5.0 - 5.5.35, 5.6.0 - 5.6.28
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 32 bytes) in /in/tH64F on line 4
Process exited with code 255.
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32 bytes) in /in/tH64F on line 4
Process exited with code 255.
Output for 5.2.3 - 5.2.17
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 71 bytes) in /in/tH64F on line 4
Process exited with code 255.
Output for 5.2.1 - 5.2.2
<br /> <b>Fatal error</b>: Allowed memory size of 134217728 bytes exhausted (tried to allocate 71 bytes) in <b>/in/tH64F</b> on line <b>4</b><br />
Process exited with code 255.
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0
<br /> <b>Fatal error</b>: Call to undefined function memory_get_usage() in <b>/in/tH64F</b> on line <b>5</b><br />
Process exited with code 255.
Output for 4.4.5 - 4.4.9
<br /> <b>Fatal error</b>: Call to undefined function: memory_get_usage() in <b>/in/tH64F</b> on line <b>5</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
<br /> <b>Fatal error</b>: Call to undefined function: memory_get_usage() in <b>/in/tH64F</b> on line <b>5</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<br /> <b>Fatal error</b>: Call to undefined function: memory_get_usage() in <b>/in/tH64F</b> on line <b>5</b><br />

preferences:
175.7 ms | 401 KiB | 205 Q