Re: RFC: Functional Interfaces

From: Date: Tue, 19 Apr 2016 00:37:27 +0000
Subject: Re: RFC: Functional Interfaces
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-92432@lists.php.net to get a copy of this message
On Mon, Apr 18, 2016 at 12:17 PM, Stanislav Malyshev <smalyshev@gmail.com> wrote: > 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? > I thought Joe covered that question pretty thoroughly by his countable examples. The version using anonymous classes certainly *works*, but it's significantly more boilerplate code and has a higher cognitive overhead compared to the functional interface example which is concise and to the point. That said, I'm not sure what I'd use it for, but as syntactic sugar goes it's quite sleek. -Sara

« previous php.internals (#92432) next »