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 { return $my_inst->alpha(); } $o = new MyClass(); echo $o->beta(); echo PHP_EOL; echo f($o);
Output for 5.3.0 - 5.4.32
<?hh class MyClass { public function alpha(): int { return 1; } public function beta(): string { return 'hi test'; } } function f(MyClass $my_inst): int { return $my_inst->alpha(); } $o = new MyClass(); echo $o->beta(); echo PHP_EOL; echo f($o);