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()); } echo PHP_EOL . ' init $array with 10k elements...' . PHP_EOL; $array = range(1,10000); var_dump(memory_get_usage()); myfunction($array);
Output for 7.0.0 - 7.1.0
init $array with 10k elements... int(876048) pass $array to function... int(876048) modify $array... int(1404488)
Output for hhvm-3.10.0 - 3.12.0
init $array with 10k elements... int(2097152) pass $array to function... int(2097152) modify $array... int(2097152)
Output for 5.6.7 - 5.6.28
init $array with 10k elements... int(1710912) pass $array to function... int(1710960) modify $array... int(2722232)
Output for 5.5.24 - 5.5.35
init $array with 10k elements... int(1710920) pass $array to function... int(1710968) modify $array... int(2722248)
Output for 5.4.10 - 5.4.45
init $array with 10k elements... int(1711424) pass $array to function... int(1711472) modify $array... int(2722744)
Output for 5.4.0 - 5.4.9
init $array with 10k elements... int(1711432) pass $array to function... int(1711480) modify $array... int(2722752)
Output for 5.3.11 - 5.3.29
init $array with 10k elements... int(2114248) pass $array to function... int(2114248) modify $array... int(3125536)
Output for 5.3.0 - 5.3.10
init $array with 10k elements... int(2113928) pass $array to function... int(2113928) modify $array... int(3125200)
Output for 5.2.10 - 5.2.17
init $array with 10k elements... int(1492848) pass $array to function... int(1493112) modify $array... int(2504384)
Output for 5.2.7 - 5.2.9
init $array with 10k elements... int(1494696) pass $array to function... int(1494976) modify $array... int(2506296)
Output for 5.2.3 - 5.2.6
init $array with 10k elements... int(1495024) pass $array to function... int(1495304) modify $array... int(2506624)
Output for 5.2.2
init $array with 10k elements... int(1492872) pass $array to function... int(1493152) modify $array... int(2504472)
Output for 5.2.1
init $array with 10k elements... int(1492448) pass $array to function... int(1492680) modify $array... int(2504000)
Output for 5.0.2 - 5.2.0
init $array with 10k elements... Fatal error: Call to undefined function memory_get_usage() in /in/Zgc7p on line 13
Process exited with code 255.
Output for 5.0.0 - 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/Zgc7p on line 11 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/Zgc7p on line 11 PHP_EOL init $array with 10k elements...PHP_EOL Fatal error: Call to undefined function memory_get_usage() in /in/Zgc7p on line 13
Process exited with code 255.
Output for 4.4.5 - 4.4.9
init $array with 10k elements... Fatal error: Call to undefined function: memory_get_usage() in /in/Zgc7p on line 13
Process exited with code 255.
Output for 4.3.10 - 4.4.4
init $array with 10k elements... Fatal error: Call to undefined function: memory_get_usage() in /in/Zgc7p on line 13
Process exited with code 255.
Output for 4.3.2 - 4.3.9
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/Zgc7p on line 11 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/Zgc7p on line 11 PHP_EOL init $array with 10k elements...PHP_EOL Fatal error: Call to undefined function: memory_get_usage() in /in/Zgc7p on line 13
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/Zgc7p on line 11 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/Zgc7p on line 11 PHP_EOL init $array with 10k elements...PHP_EOL Fatal error: Call to undefined function: memory_get_usage() in /in/Zgc7p on line 13