3v4l.org

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