3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php echo "Starting in_array\n"; $limit = 40000; $arr = [30, 367]; $time = microtime(true); for($i = 0; $i < $łimit; ++$i) { if (in_array($i, $arr)) { } } $time = microtime(true) - $time; echo 'in_array() took ' . number_format($time, 3) . " seconds\n"; $time = microtime(true); for($i = 0; $i < $łimit; ++$i) { if ($i === 30 || $i === 367) { } } $time = microtime(true) - $time; echo 'in_array() took ' . number_format($time, 3) . " seconds\n";
Output for 5.4.0 - 7.1.0
Starting in_array Notice: Undefined variable: łimit in /in/M9nJ9 on line 8 in_array() took 0.000 seconds Notice: Undefined variable: łimit in /in/M9nJ9 on line 17 in_array() took 0.000 seconds
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/M9nJ9 on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/M9nJ9 on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/M9nJ9 on line 5
Process exited with code 255.