Closed thekid closed 5 years ago
We also have the compact method syntax which reuses the ==>
Operator:
class Person {
private string $name;
public function name() ==> $this->name;
}
This is supported neither by Hack nor by PHP but an idea that I borrowed from the original XP Compiler. The question is whether it should be rewritten to use fn
and the =>
operator for sake of consistency - see https://wiki.php.net/rfc/arrow_functions_v2#allow_arrow_notation_for_real_functions
The ==>
syntax should be deprecated in 2.X releases, and removed in 3.0.0
Currently, the compiler supports the Hack language variant, see https://docs.hhvm.com/hack/functions/anonymous-functions:
However, PHP 7.4 has decided to go a different way, introducing the
fn
keyword in https://wiki.php.net/rfc/arrow_functions_v2, which makes it:The XP Compiler should adopt the latter.