3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class test {} function test(): \stdClass { return new test(); } test();
based on ClpId
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Return value of test() must be an instance of stdClass, instance of test returned in /in/ZmgTg:5 Stack trace: #0 /in/ZmgTg(8): test() #1 {main} thrown in /in/ZmgTg on line 5
Process exited with code 255.
Output for 5.4.0 - 5.6.26
Parse error: syntax error, unexpected ':', expecting '{' in /in/ZmgTg on line 4
Process exited with code 255.