3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $fh = fopen('/dev/urandom', 'r'); print_r($fh); echo "\n"; var_export($fh); echo "\n"; var_dump($fh); echo "\n"; printf( '%s of type "%s"', print_r($variable, true), get_resource_type($variable) );
Output for 7.0.0 - 7.1.0
Resource id #5 NULL resource(5) of type (stream) Notice: Undefined variable: variable in /in/8Dqq7 on line 11 Notice: Undefined variable: variable in /in/8Dqq7 on line 12 Warning: get_resource_type() expects parameter 1 to be resource, null given in /in/8Dqq7 on line 12 of type ""
Output for 5.3.0 - 5.6.28
Resource id #5 NULL resource(5) of type (stream) Notice: Undefined variable: variable in /in/8Dqq7 on line 12 Notice: Undefined variable: variable in /in/8Dqq7 on line 13 Warning: get_resource_type() expects parameter 1 to be resource, null given in /in/8Dqq7 on line 13 of type ""
Output for 5.2.3 - 5.2.17
Resource id #5 NULL resource(5) of type (stream) Notice: Undefined variable: variable in /in/8Dqq7 on line 12 Notice: Undefined variable: variable in /in/8Dqq7 on line 13 Warning: Supplied argument is not a valid resource handle in /in/8Dqq7 on line 13 of type ""
Output for 5.0.4 - 5.2.2
Resource id #2 NULL resource(2) of type (stream) Notice: Undefined variable: variable in /in/8Dqq7 on line 12 Notice: Undefined variable: variable in /in/8Dqq7 on line 13 Warning: Supplied argument is not a valid resource handle in /in/8Dqq7 on line 13 of type ""
Output for 5.0.0 - 5.0.3
Resource id #2 NULL resource(2) of type (stream) Notice: Undefined variable: variable in /in/8Dqq7 on line 12 Notice: Undefined variable: variable in /in/8Dqq7 on line 13 Warning: Supplied argument is not a valid resource handle in /in/8Dqq7 on line 13 of type ""
Output for 4.3.0 - 4.4.9
Resource id #1 NULL resource(1) of type (stream) Notice: Undefined variable: variable in /in/8Dqq7 on line 12 Notice: Undefined variable: variable in /in/8Dqq7 on line 13 Warning: Supplied argument is not a valid resource handle in /in/8Dqq7 on line 13 of type ""