Re: RFC: Functional Interfaces
| From: | Marcio Almada | Date: | Mon, 18 Apr 2016 21:01:53 +0000 |
| Subject: | Re: RFC: Functional Interfaces | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-92429@lists.php.net to get a copy of this message | ||
Hi!
2016-04-18 15:17 GMT-04:00 Stanislav Malyshev <smalyshev@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
> smalyshev@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.