3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $stream = fopen('php://output', 'a'); var_dump($stream); var_dump(is_resource($stream)); fclose($stream); var_dump(is_resource($stream)); var_dump($stream); fclose($stream);
Output for 7.0.0 - 7.1.0
resource(5) of type (stream) bool(true) bool(false) resource(5) of type (Unknown) Warning: fclose(): supplied resource is not a valid stream resource in /in/DNupZ on line 9
Output for hhvm-3.10.0 - 3.13.2
resource(4) of type (stream) bool(true) bool(false) resource(4) of type (Unknown) Warning: Not a valid stream resource in /in/DNupZ on line 9
Output for 5.2.3 - 5.6.28
resource(5) of type (stream) bool(true) bool(false) resource(5) of type (Unknown) Warning: fclose(): 5 is not a valid stream resource in /in/DNupZ on line 9
Output for 5.0.0 - 5.2.2
resource(2) of type (stream) bool(true) bool(false) resource(2) of type (Unknown) Warning: fclose(): 2 is not a valid stream resource in /in/DNupZ on line 9
Output for 4.3.6 - 4.4.9
resource(1) of type (stream) bool(true) bool(false) resource(1) of type (Unknown) Warning: fclose(): 1 is not a valid stream resource in /in/DNupZ on line 9
Output for 4.3.0 - 4.3.5
resource(1) of type (stream) bool(true) bool(true) resource(1) of type (Unknown) Warning: fclose(): 1 is not a valid stream resource in /in/DNupZ on line 9