3v4l.org

run code in 300+ PHP versions simultaneously
<?php $value = base64_encode(md5('')); $start = microtime(true); for ($i = 0; $i < 100; ++$i) { $result = []; do { $result[] = $value; $value = substr($value, 0, -1); } while ('' !== $value); } $end = microtime(true); echo $i/($end - $start), ' op/s', PHP_EOL; var_dump($result);
Output for 7.0.20, 7.1.5 - 7.1.33, 7.2.0 - 7.2.25, 7.3.0 - 7.3.12, 7.4.0
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 67108872 bytes) in /in/ZHJoo on line 8
Process exited with code 255.
Output for 5.4.0 - 5.4.26
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 32 bytes) in /in/ZHJoo on line 9
Process exited with code 255.
Output for 5.3.7 - 5.3.28
Parse error: syntax error, unexpected '[' in /in/ZHJoo on line 6
Process exited with code 255.

preferences:
97.4 ms | 401 KiB | 104 Q