4 ms·
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 =
by djxfade 1y 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
- deleted 1y ago[deleted]
- dotancohen 1y agoThis "arrow function" syntax was introduced much later, though.