3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function recurse_array(&$in) { if (is_array($in)) { foreach ($in as $val) { recurse_array($val); } } } $array = range(1, 10); $array[10] = $array; $array[10][10] = $array; $array[10][10][10] = $array; $array[10][10][10][10] = $array; $array[10][10][10][10][10] = $array; echo 'memory before: ', memory_get_peak_usage(true); recurse_array($array); echo 'memory after: ', memory_get_peak_usage(true);
Output for 7.0.0 - 7.1.0
memory before: 2097152memory after: 2097152
Output for hhvm-3.12.0
memory before: 307400memory after: 307416
Output for hhvm-3.10.0
memory before: 305744memory after: 305760
Output for 5.4.0 - 5.6.28
memory before: 262144memory after: 524288
Output for 5.3.0 - 5.3.29
memory before: 786432memory after: 786432
Output for 5.2.6 - 5.2.17
memory before: 262144memory after: 262144
Output for 5.2.1 - 5.2.5
memory before: 262144
Process exited with code 139.
Output for 5.0.0 - 5.2.0
memory before: Fatal error: Call to undefined function memory_get_peak_usage() in /in/5WeBB on line 19
Process exited with code 255.
Output for 4.4.5 - 4.4.9
memory before: Fatal error: Call to undefined function: memory_get_peak_usage() in /in/5WeBB on line 19
Process exited with code 255.
Output for 4.3.2 - 4.4.4
memory before: Fatal error: Call to undefined function: memory_get_peak_usage() in /in/5WeBB on line 19
Process exited with code 255.
Output for 4.3.0 - 4.3.1
memory before: Fatal error: Call to undefined function: memory_get_peak_usage() in /in/5WeBB on line 19