3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $s = ''; for ($i = 0; $i < 10000000; ++$i) { // 10 MB $s .= rand(0, 9); } $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.0.0 - 7.2.0
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 60000032 bytes) in /in/vl5Lm on line 10
Process exited with code 255.
Output for 5.3.7 - 5.3.9, 5.3.11 - 5.3.16, 5.3.18 - 5.3.21, 5.3.23 - 5.3.24, 5.4.2 - 5.4.13, 5.4.16 - 5.4.34, 5.4.36 - 5.4.38, 5.4.40 - 5.4.43, 5.4.45 - 5.5.34, 5.6.8 - 5.6.28
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 40000001 bytes) in /in/vl5Lm on line 10
Process exited with code 255.
Output for 5.3.10, 5.3.17, 5.3.22, 5.3.25 - 5.4.1, 5.4.14 - 5.4.15, 5.4.35, 5.4.39, 5.4.44, 5.5.35 - 5.6.7

Process exited with code 137.