3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function myfunction($array){ echo PHP_EOL . ' pass $array to function...' . PHP_EOL; var_dump(memory_get_usage()); echo PHP_EOL . ' modify $array...' . PHP_EOL; $array[343] = 23; var_dump(memory_get_usage()); } $array = range(1,10000); var_dump(memory_get_usage()); myfunction($array);
Output for 7.0.0 - 7.1.0
int(875936) pass $array to function... int(875968) modify $array... int(1404408)
Output for hhvm-3.10.0 - 3.12.0
int(2097152) pass $array to function... int(2097152) modify $array... int(2097152)
Output for 5.6.7 - 5.6.21
int(1710640) pass $array to function... int(1710736) modify $array... int(2722008)
Output for 5.5.24 - 5.5.35
int(1710640) pass $array to function... int(1710720) modify $array... int(2722008)
Output for 5.4.10 - 5.4.45
int(1711136) pass $array to function... int(1711216) modify $array... int(2722488)
Output for 5.4.0 - 5.4.9
int(1711112) pass $array to function... int(1711192) modify $array... int(2722464)
Output for 5.3.11 - 5.3.29
int(2113760) pass $array to function... int(2113792) modify $array... int(3125064)
Output for 5.3.0 - 5.3.10
int(2113440) pass $array to function... int(2113472) modify $array... int(3124744)
Output for 5.2.10 - 5.2.17
int(1492064) pass $array to function... int(1492360) modify $array... int(2503616)
Output for 5.2.7 - 5.2.9
int(1493920) pass $array to function... int(1494280) modify $array... int(2505552)
Output for 5.2.3 - 5.2.6
int(1494256) pass $array to function... int(1494616) modify $array... int(2505888)
Output for 5.2.2
int(1492136) pass $array to function... int(1492416) modify $array... int(2503736)
Output for 5.2.1
int(1491688) pass $array to function... int(1491920) modify $array... int(2503240)
Output for 5.0.0 - 5.2.0
Fatal error: Call to undefined function memory_get_usage() in /in/odH2O on line 12
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: memory_get_usage() in /in/odH2O on line 12
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: memory_get_usage() in /in/odH2O on line 12
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: memory_get_usage() in /in/odH2O on line 12