3v4l.org

run code in 300+ PHP versions simultaneously
<?php $s = ''; for ($i = 0; $i < 10000000; ++$i) { // 10 MB $s .= rand(0, 9); } $s .= $s . $s . $s . $s . $s . $s . $s . $s . $s; // 100Mb echo "data: " . mb_strlen($s) / (1024 * 1024) . " Mb"; $start = microtime(true); for ($i = 0; $i < 1000; ++$i) { mb_strlen($s); } $end = microtime(true); echo "result = " . ($end - $start);
Output for 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 60000032 bytes) in /in/aYusk on line 7
Process exited with code 255.
Output for 5.3.9, 5.3.16, 7.1.29, 7.1.32 - 7.1.33

Process exited with code 137.
Output for 7.0.20, 7.1.5 - 7.1.28, 7.1.30 - 7.1.31
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 60000032 bytes) in /in/aYusk on line 10
Process exited with code 255.
Output for 5.3.7 - 5.3.8, 5.3.10 - 5.3.15, 5.3.17 - 5.3.28, 5.4.0 - 5.4.30
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 40000001 bytes) in /in/aYusk on line 10
Process exited with code 255.

preferences:
104.34 ms | 402 KiB | 94 Q