3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php namespace Sample; var_dump(is_resource(STDOUT)); function f1($f) { fwrite($f, "1 called!\n"); } function f2(\\resource $f) { fwrite($f, "2 called!\n"); } function f3(resource $f) { fwrite($f, "3 called!\n"); } f1(STDOUT); f2(STDOUT); f3(STDOUT);
based on TjVWS
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.1.7
Parse error: syntax error, unexpected '\' (T_NS_SEPARATOR), expecting identifier (T_STRING) in /in/09aXV on line 11
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: syntax error, unexpected T_NS_SEPARATOR in /in/09aXV:11 Stack trace: #0 {main}
Process exited with code 255.