Hi!

2016-04-18 15:17 GMT-04:00 Stanislav Malyshev <smalys...@gmail.com>:

> Hi!
>
> >     Please review the following RFC:
> >
> >     https://wiki.php.net/rfc/functional-interfaces
> >
> >     An implementation is provided, and is testable on 3v4l.
>
> This looks like a rather narrow case already covered by anonymous
> classes. Am I missing something? What is the added value of it that
> can't be done now?
>
> --
> Stas Malyshev
> smalys...@gmail.com
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>

I haven't decided if I'm in favor of this feature yet but I asked the same
questions as you when the pull request landed. This gist served as a good
illustration of possible benefits
https://gist.github.com/marcioAlmada/12ef23038bcf5acaa2e2f6b808c968d3.
Boilerplate measuring apart, it seems logical that a closure should be able
to fulfill an interface with a single method.

About the applicability, I'm under the same impression as you, the use case
is probably narrow, perhaps because anonymous classes is a newly added
feature and wasn't explored enough.

Cheers.
Márcio Almada.

Reply via email to