3v4l.org

run code in 300+ PHP versions simultaneously
<?php $count = 100000; $time = microtime(true); $items = array(); for ($i = 0; $i < $count; $i++) { $item = array(); $item['some_simple_key_0'] = 'value 0'; $item['some_simple_key_1'] = 'value 1'; $item['some_simple_key_2'] = 'value 2'; $item['some_simple_key_3'] = 'value 3'; $item['some_simple_key_4'] = 'value 4'; $item['some_simple_key_5'] = 'value 5'; $item['some_simple_key_6'] = 'value 6'; $item['some_simple_key_7'] = 'value 7'; $item['some_simple_key_8'] = 'value 8'; $item['some_simple_key_9'] = 'value 9'; $val = $item['some_simple_key_0']; $val = $item['some_simple_key_1']; $val = $item['some_simple_key_2']; $val = $item['some_simple_key_3']; $val = $item['some_simple_key_4']; $val = $item['some_simple_key_5']; $val = $item['some_simple_key_6']; $val = $item['some_simple_key_7']; $val = $item['some_simple_key_8']; $val = $item['some_simple_key_9']; $items[] = $item; } $spentTime = microtime(true) - $time; echo number_format($spentTime, 3) . ' seconds';
Output for 7.0.0 - 7.0.11, 7.0.13 - 7.0.14, 7.0.16 - 7.0.33, 7.1.0 - 7.1.1, 7.1.3 - 7.1.33, 7.2.0 - 7.2.26, 7.3.0 - 7.3.13, 7.4.0 - 7.4.1
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 20480 bytes) in /in/9GEU9 on line 20
Process exited with code 255.
Output for 5.6.32, 5.6.34, 7.0.12, 7.0.15, 7.1.2

Process exited with code 137.
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.31, 5.6.33, 5.6.35 - 5.6.40
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 72 bytes) in /in/9GEU9 on line 34
Process exited with code 255.
Output for 5.4.10 - 5.4.45
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 72 bytes) in /in/9GEU9 on line 19
Process exited with code 255.
Output for 5.4.0 - 5.4.9
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 32 bytes) in /in/9GEU9 on line 12
Process exited with code 255.
Output for 5.3.11 - 5.3.29
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 32 bytes) in /in/9GEU9 on line 18
Process exited with code 255.
Output for 5.3.0 - 5.3.10
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 89 bytes) in /in/9GEU9 on line 20
Process exited with code 255.

preferences:
231.65 ms | 401 KiB | 272 Q