<?hh
namespace A {
class T {}
}
namespace {
$hello = 42;
class Test
{
public function first(string $str): Closure
{
return function(): int use ($str) {
return strlen($str);
};
}
public function second(int $i): self
{
}
}
$t = new Test;
echo ($t->first("hello"))();
}
<?hh
namespace A {
class T {}
}
namespace {
$hello = 42;
class Test
{
public function first(string $str): Closure
{
return function(): int use ($str) {
return strlen($str);
};
}
public function second(int $i): self
{
}
}
$t = new Test;
echo ($t->first("hello"))();
}
Output for 8.0.13
Parse error: syntax error, unexpected token "namespace" in /in/WqFq0 on line 3
Process exited with code 255.