Re: Re: [RFC][Discuss] Arrow Functions
| From: | Niklas Keller | Date: | Fri, 03 Feb 2017 22:47:26 +0000 |
| Subject: | Re: Re: [RFC][Discuss] Arrow Functions | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-98151@lists.php.net to get a copy of this message | ||
2017-02-03 23:26 GMT+01:00 Michael Morris <tendoaki@gmail.com>:
> On Fri, Feb 3, 2017 at 3:37 PM, Niklas Keller <me@kelunik.com> wrote:
> >
> >
> > There are more drawbacks to that syntax like no parameters looking pretty
> > weird: || =>
> >
> >
> I can't think of a valid example of an arrow function without any arguments
> at all. These functions are very simple iterators to plug into things like
> array_map. If you can think of one please post it.
>
One example might be callbacks operating on
$this:
register_some_callback(|| => $this->someFlag = false);
Another example are supplier functions as mentioned by Fleshgrinder.
Regards, Niklas