3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Whatever { public function readMe(Whatever $arg) { if ($arg === null) { echo 'no way'; } else { echo 'bla bla'; } } } $whatever = new Whatever(); $nothing = null; $whatever->readMe($whatever); $whatever->readMe($nothing);
Output for 7.0.0 - 7.1.0
bla bla Fatal error: Uncaught TypeError: Argument 1 passed to Whatever::readMe() must be an instance of Whatever, null given, called in /in/GX4U2 on line 13 and defined in /in/GX4U2:4 Stack trace: #0 /in/GX4U2(13): Whatever->readMe(NULL) #1 {main} thrown in /in/GX4U2 on line 4
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
bla bla Catchable fatal error: Argument 1 passed to Whatever::readMe() must be an instance of Whatever, null given in /in/GX4U2 on line 6
Process exited with code 255.
Output for 5.2.0 - 5.6.28
bla bla Catchable fatal error: Argument 1 passed to Whatever::readMe() must be an instance of Whatever, null given, called in /in/GX4U2 on line 13 and defined in /in/GX4U2 on line 4
Process exited with code 255.
Output for 5.1.0 - 5.1.6
bla bla Fatal error: Argument 1 passed to Whatever::readMe() must not be null, called in /in/GX4U2 on line 13 and defined in /in/GX4U2 on line 4
Process exited with code 255.
Output for 5.0.0 - 5.0.5
bla bla Fatal error: Argument 1 must not be null in /in/GX4U2 on line 4
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/GX4U2 on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/GX4U2 on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/GX4U2 on line 4
Process exited with code 255.