3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $handle = fopen(__FILE__, 'r'); var_dump(get_resource_type($handle)); fclose($handle); fclose($handle); var_dump(gettype($handle), $handle);
Output for 7.2.0 - 7.3.0rc4
string(6) "stream" Warning: fclose(): supplied resource is not a valid stream resource in /in/vJatm on line 6 string(17) "resource (closed)" resource(5) of type (Unknown)
Output for 7.0.0 - 7.1.20
string(6) "stream" Warning: fclose(): supplied resource is not a valid stream resource in /in/vJatm on line 6 string(12) "unknown type" resource(5) of type (Unknown)
Output for 5.2.3 - 5.6.28
string(6) "stream" Warning: fclose(): 5 is not a valid stream resource in /in/vJatm on line 6 string(12) "unknown type" resource(5) of type (Unknown)
Output for 5.1.0 - 5.2.2
string(6) "stream" Warning: fclose(): 2 is not a valid stream resource in /in/vJatm on line 6 string(12) "unknown type" resource(2) of type (Unknown)
Output for 5.0.0 - 5.0.5
string(6) "stream" Warning: fclose(): 2 is not a valid stream resource in /in/vJatm on line 6 string(8) "resource" resource(2) of type (Unknown)
Output for 4.3.0 - 4.4.9
string(6) "stream" Warning: fclose(): 1 is not a valid stream resource in /in/vJatm on line 6 string(8) "resource" resource(1) of type (Unknown)