Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
djxfade
44 days ago
|
parent
|
context
|
favorite
| on:
Exploring Coroutines in PHP
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
dotancohen
44 days ago
[–]
This "arrow function" syntax was introduced much later, though.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: