3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class foo { function bar() { echo "this is " . (!empty($this) && !is_null($this) ? 'not ' : '') . "null\n"; } } foo::bar(); (new foo)->bar();
based on oXtNZ
Output for 7.0.0 - 7.2.0
Deprecated: Non-static method foo::bar() should not be called statically in /in/pBuQd on line 8 this is null this is not null
Output for 5.4.2 - 5.6.28
Strict Standards: Non-static method foo::bar() should not be called statically in /in/pBuQd on line 8 this is null this is not null
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/pBuQd on line 9
Process exited with code 255.