3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = str_repeat('1', 1024 * 1024); var_dump(memory_get_usage()); $str2 = (string)$str; var_dump(memory_get_usage());
Output for 7.4.0 - 7.4.1
int(1439360) int(1439392)
Output for 7.3.0 - 7.3.13
int(1439280) int(1439312)
Output for 7.2.0 - 7.2.26
int(1435400) int(1435432)
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33
int(1398696) int(1398728)
Output for 5.6.0 - 5.6.40
int(1265456) int(2314240)
Output for 5.5.0 - 5.5.38
int(1265456) int(2314232)
Output for 5.4.10 - 5.4.45
int(1265976) int(2314744)
Output for 5.4.0 - 5.4.9
int(1265448) int(2314216)
Output for 5.3.11 - 5.3.29
int(1668144) int(2716920)
Output for 5.3.0 - 5.3.10
int(1667840) int(2716616)
Output for 5.2.10 - 5.2.17
int(1125792) int(2174560)
Output for 5.2.7 - 5.2.9
int(1126264) int(2175040)
Output for 5.2.3 - 5.2.6
int(1126584) int(2175360)
Output for 5.2.1 - 5.2.2
int(1124608) int(2173304)
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/jnCog on line 4
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: memory_get_usage() in /in/jnCog on line 4
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/jnCog on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: memory_get_usage() in /in/jnCog on line 4

preferences:
213.31 ms | 401 KiB | 325 Q