3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * For this test someone has written a lot of crap PHP code! * List all the problems you can find with this code and why it is a problem * */ function countVowelsInFile($f) { $handle = fopen($f); while (!feof($handle)) $buf = fgets($handle, 4096); for ($i = 0; $i < strlen($buf); $i++) { if ($buf[$i] == 'a') $a++; if ($buf[$i] == 'e') $e++; if ($buf[$i] == 'i') $i++; if ($buf[$i] == 'o') $o++; if ($buf[$i] == 'u') $u++; if ($buf[$i] == 'e') $e++; } fclose($handle); return $a + $e + $i + $o + $u; } countVowelsInFile(__FILE__);

preferences:
36.78 ms | 402 KiB | 5 Q