Hacker News new | ask | show | jobs
by djxfade 346 days ago
That's not totally correct. PHP has a "short function" syntax for that specific use case, it automatically captures data without the 'use' statement.

    $a = 5;
    $b = fn ($c) => $a * $b;
    print($b(2)); // 10
    print($b(4)); // 20
1 comments

This "arrow function" syntax was introduced much later, though.