Re: [RFC] Scope functions
| From: | MCode | Date: | Thu, 28 May 2026 21:46:22 +0000 |
| Subject: | Re: [RFC] Scope functions | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-131044@lists.php.net to get a copy of this message | ||
> I think the current syntax is too close to current short closures
I agree.
I don't think we need a new keyword, I think the presence of
=> in the function
definition should indicate that scope is captured, like this:
```
function() => {
// ...
}
```
To put it another way fn() => foo; would be a syntactically identical version of
function() => {return foo;}