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__);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught ArgumentCountError: fopen() expects at least 2 arguments, 1 given in /in/B7BF7:10 Stack trace: #0 /in/B7BF7(10): fopen('/in/B7BF7') #1 /in/B7BF7(27): countVowelsInFile('/in/B7BF7') #2 {main} thrown in /in/B7BF7 on line 10
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
59.26 ms | 401 KiB | 8 Q