3v4l.org

run code in 150+ 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.26, 7.0.0 - 7.0.11
Parse error: syntax error, unexpected 'class' (T_CLASS) in /in/EKdZv on line 3
Process exited with code 255.
Output for hhvm-3.10.0 - 3.13.2
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(); }