|
|
|
|
|
by johannes1234321
2401 days ago
|
|
As you mentioned the => syntax is already being used in PHP with associative arrays and can conflict in some places. Taking your example [$x => $x*2] this creates an array with $x doubled on index $x, while a user might want to create an array of functions. The fn() syntax was a non-conflicting alternative, which got most support for being not too weird. |
|
[1] https://docs.hhvm.com/hack/functions/anonymous-functions