3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $cars=array(array("bmw",20,10,20),array("benz",30,10,0),array("gator",20,40,9),array("ferrari",15,60,18)); for ($row = 0; $row < 4; $row++) { for ($col = 0; $col < 4; $col++) { echo $cars[$row][$col]; } } echo "\n"; $myfile = fopen("webdictionary.txt", "r") or ("Unable to open file!"); echo fread($myfile,filesize("webdictionary.txt")); fclose($myfile);
based on uFdCT
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
bmw201020benz30100gator20409ferrari156018 Warning: fopen(webdictionary.txt): failed to open stream: No such file or directory in /in/Dlflg on line 12 Warning: filesize(): stat failed for webdictionary.txt in /in/Dlflg on line 13 Warning: fread() expects parameter 1 to be resource, boolean given in /in/Dlflg on line 13 Warning: fclose() expects parameter 1 to be resource, boolean given in /in/Dlflg on line 14
Output for hhvm-3.10.0 - 3.12.0
bmw201020benz30100gator20409ferrari156018 Warning: No such file or directory in /in/Dlflg on line 12 Warning: filesize(): No such file or directory in /in/Dlflg on line 13 Warning: fread() expects parameter 1 to be resource, boolean given in /in/Dlflg on line 13 Warning: fclose() expects parameter 1 to be resource, boolean given in /in/Dlflg on line 14
Output for 5.0.0 - 5.2.17
bmw201020benz30100gator20409ferrari156018 Warning: fopen(webdictionary.txt): failed to open stream: No such file or directory in /in/Dlflg on line 12 Warning: filesize(): stat failed for webdictionary.txt in /in/Dlflg on line 13 Warning: fread(): supplied argument is not a valid stream resource in /in/Dlflg on line 13 Warning: fclose(): supplied argument is not a valid stream resource in /in/Dlflg on line 14
Output for 4.3.2 - 4.4.9
bmw201020benz30100gator20409ferrari156018 Warning: fopen(webdictionary.txt): failed to open stream: No such file or directory in /in/Dlflg on line 12 Warning: filesize(): Stat failed for webdictionary.txt (errno=2 - No such file or directory) in /in/Dlflg on line 13 Warning: fread(): supplied argument is not a valid stream resource in /in/Dlflg on line 13 Warning: fclose(): supplied argument is not a valid stream resource in /in/Dlflg on line 14
Output for 4.3.0 - 4.3.1
bmw201020benz30100gator20409ferrari156018 Warning: fopen(webdictionary.txt) [http://www.php.net/function.fopen]: failed to create stream: No such file or directory in /in/Dlflg on line 12 Warning: filesize() [http://www.php.net/function.filesize]: Stat failed for webdictionary.txt (errno=2 - No such file or directory) in /in/Dlflg on line 13 Warning: fread(): supplied argument is not a valid stream resource in /in/Dlflg on line 13 Warning: fclose(): supplied argument is not a valid stream resource in /in/Dlflg on line 14