3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $constant = 'STDOUT'; var_dump(constant($constant)); fclose($constant); var_dump(constant($constant));
Output for 5.3.0 - 7.1.0
resource(2) of type (stream) Warning: fclose() expects parameter 1 to be resource, string given in /in/WZiWI on line 4 resource(2) of type (stream)
Output for 5.2.3 - 5.2.17
resource(2) of type (stream) Warning: fclose(): supplied argument is not a valid stream resource in /in/WZiWI on line 4 resource(2) of type (stream)
Output for 4.3.2 - 5.2.2
Warning: constant(): Couldn't find constant STDOUT in /in/WZiWI on line 3 NULL Warning: fclose(): supplied argument is not a valid stream resource in /in/WZiWI on line 4 Warning: constant(): Couldn't find constant STDOUT in /in/WZiWI on line 5 NULL
Output for 4.3.0 - 4.3.1
Warning: constant() [http://www.php.net/function.constant]: Couldn't find constant STDOUT in /in/WZiWI on line 3 NULL Warning: fclose(): supplied argument is not a valid stream resource in /in/WZiWI on line 4 Warning: constant() [http://www.php.net/function.constant]: Couldn't find constant STDOUT in /in/WZiWI on line 5 NULL