3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $data=array(); for($c=0; $c<100000; $c++) $data[$c]=array(1, 2, 3); $filter=array(1, 2, 3); for($kc=0; $kc<3; $kc++) { $cm=memory_get_usage(true); $pm=memory_get_peak_usage(true); echo "loop $kc: current_memory: $cm, peak_memory: $pm...\n"; flush(); foreach($data as $entry) foreach($filter as $pattern) continue 2; } ?>
Output for 7.1.0
loop 0: current_memory: 6295552, peak_memory: 6295552... loop 1: current_memory: 6295552, peak_memory: 6295552... loop 2: current_memory: 6295552, peak_memory: 6295552...
Output for 7.0.0 - 7.0.14
loop 0: current_memory: 44044288, peak_memory: 44044288... loop 1: current_memory: 44044288, peak_memory: 44044288... loop 2: current_memory: 44044288, peak_memory: 44044288...
Output for 5.2.7 - 5.2.9, 5.5.24 - 5.6.28
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 64 bytes) in /in/v4CMk on line 4
Process exited with code 255.
Output for 5.4.0 - 5.4.45
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 72 bytes) in /in/v4CMk on line 4
Process exited with code 255.
Output for 5.2.3 - 5.2.6, 5.3.0 - 5.3.29
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 71 bytes) in /in/v4CMk on line 4
Process exited with code 255.
Output for 5.2.1 - 5.2.2, 5.2.10 - 5.2.17
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 24 bytes) in /in/v4CMk on line 4
Process exited with code 255.
Output for 5.0.0 - 5.2.0
Fatal error: Call to undefined function memory_get_usage() in /in/v4CMk on line 9
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: memory_get_usage() in /in/v4CMk on line 9
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: memory_get_usage() in /in/v4CMk on line 9
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: memory_get_usage() in /in/v4CMk on line 9