3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?hh class MyClass { public function alpha(): int { return 1; } public function beta(): string { return 'hi test'; } } function f(MyClass $my_inst): int { // Fix me! var_dump($my_inst); return $my_inst->alpha(); }
Output for 5.4.0 - 5.6.30, 7.0.0 - 7.1.3
Parse error: syntax error, unexpected 'class' (T_CLASS) in /in/EKdZv on line 3
Process exited with code 255.
Output for hhvm-3.10.1 - 3.17.3
Output for 4.3.0 - 5.3.29
<?hh class MyClass { public function alpha(): int { return 1; } public function beta(): string { return 'hi test'; } } function f(MyClass $my_inst): int { // Fix me! var_dump($my_inst); return $my_inst->alpha(); }