2017-02-03 23:26 GMT+01:00 Michael Morris <tendo...@gmail.com>:

> On Fri, Feb 3, 2017 at 3:37 PM, Niklas Keller <m...@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

Reply via email to