3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?hh class TestingMethods { // can't do public int get() public function get() { return (int) 1; } public function get($withParams) { return (int) 2; } public function getSomething(String $something) { return "something $something"; } public function getSomething() { return "something do with with no @params"; } } $t = new TestingMethods(); $one = $t->get(); $two = $t->get($withParams); $something = $t->getSomething("something..."); $something2 = $t->getSomething(); var_dump($one); var_dump($two); var_dump($something); var_dump($something2);
based on XWZtq
Output for 5.4.0 - 5.4.32
Parse error: syntax error, unexpected 'class' (T_CLASS) in /in/qWDiK on line 3
Process exited with code 255.