3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { function get() {} function set($bar) {} } class Qux extends Foo { function get(): Baz {} function set(Baz $bar) {} }
Output for 7.0.0 - 7.3.1
Warning: Declaration of Qux::set(Baz $bar) should be compatible with Foo::set($bar) in /in/gZfK4 on line 11
Output for hhvm-3.15.4 - 3.22.0
Output for 5.6.30
Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/gZfK4 on line 9
Process exited with code 255.