<?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);
<?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);
Output for 8.0.13
Parse error: syntax error, unexpected token "class" in /in/qWDiK on line 3
Process exited with code 255.
Output for 5.4.0 - 5.4.32, 7.3.32 - 7.3.33, 7.4.33
Parse error: syntax error, unexpected 'class' (T_CLASS) in /in/qWDiK on line 3
Process exited with code 255.