3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { public function query(): array { return []; } } class B extends A { public function query(): int { return 0; } } $o = new B; var_dump($o->query());
Output for 7.0.0 - 7.1.7
Fatal error: Declaration of B::query(): int must be compatible with A::query(): array in /in/EoXf6 on line 13
Process exited with code 255.
Output for hhvm-3.15.4
int(0)
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/EoXf6 on line 4
Process exited with code 255.