Arrow functions were introduced in PHP 7.4 making them similar to JavaScript’s arrow functions.
See how $y is scoped on both functions.
$y = 1;
$fn1 = fn($x) => $x + $y;
// equivalent to using $y by value:
$fn2 = function ($x) use ($y) {
return $x + $y;
};