3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { public function test() : void { } } $f = new Foo; $result = $f->test(); var_dump(isset($result));
based on Omked
Output for 7.1.0 - 7.2.0
bool(false)
Output for 7.0.0 - 7.0.20
Fatal error: Uncaught TypeError: Return value of Foo::test() must be an instance of void, none returned in /in/TlrFV:8 Stack trace: #0 /in/TlrFV(14): Foo->test() #1 {main} thrown in /in/TlrFV on line 8
Process exited with code 255.
Output for 5.3.18 - 5.6.28
Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/TlrFV on line 5
Process exited with code 255.