3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $f = fopen('somefile.txt','r'); echo gettype($f); // resource fclose($f); echo gettype($f); // unknown
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: fopen(somefile.txt): failed to open stream: No such file or directory in /in/hvZMK on line 3 boolean Warning: fclose() expects parameter 1 to be resource, boolean given in /in/hvZMK on line 5 boolean
Output for hhvm-3.12.0
Warning: No such file or directory in /in/hvZMK on line 3 boolean Warning: fclose() expects parameter 1 to be resource, boolean given in /in/hvZMK on line 5 boolean
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.3.2 - 5.0.5, 5.1.1 - 5.2.17
Warning: fopen(somefile.txt): failed to open stream: No such file or directory in /in/hvZMK on line 3 boolean Warning: fclose(): supplied argument is not a valid stream resource in /in/hvZMK on line 5 boolean
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/hvZMK on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: fopen(somefile.txt) [http://www.php.net/function.fopen]: failed to create stream: No such file or directory in /in/hvZMK on line 3 boolean Warning: fclose(): supplied argument is not a valid stream resource in /in/hvZMK on line 5 boolean