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(), "\n"; recurse_array($array); echo 'memory after: ', memory_get_peak_usage();
Output for 7.1.0
memory before: 384168 memory after: 384168
Output for 7.0.0 - 7.0.14
memory before: 384152 memory after: 384152
Output for 5.6.0 - 5.6.28
memory before: 243200 memory after: 263248
Output for 5.5.0 - 5.5.36
memory before: 243152 memory after: 263160
Output for 5.4.10 - 5.4.45
memory before: 243096 memory after: 263032
Output for 5.4.0 - 5.4.9
memory before: 243088 memory after: 263024
Output for 5.3.11 - 5.3.29
memory before: 648432 memory after: 668368
Output for 5.3.0 - 5.3.10
memory before: 648128 memory after: 668064
Output for 5.2.10 - 5.2.17
memory before: 105424 memory after: 130944
Output for 5.2.7 - 5.2.9
memory before: 105504 memory after: 131024
Output for 5.2.6
memory before: 105824 memory after: 131344
Output for 5.2.3 - 5.2.5
memory before: 103880
Process exited with code 139.
Output for 5.2.2
memory before: 101744
Process exited with code 139.
Output for 5.2.1
memory before: 101824
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/AWs6B 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/AWs6B 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/AWs6B 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/AWs6B on line 19