Re: RFC proposal: Invokable interface

From: Date: Mon, 30 Mar 2026 09:51:22 +0000
Subject: Re: RFC proposal: Invokable interface
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-130491@lists.php.net to get a copy of this message
On Monday 30 March 2026 10:37:49 (+02:00), Rowan Tommins [IMSoP] wrote:
On 30 March 2026 08:58:03 BST, Rob Landers <rob@bottled.codes> wrote:
I'd prefer if the interface forced an empty argument set. You can add arguments so long as they're optional. But generally speaking, there is no need for arguments on an invokable class -- that is what constructors and properties are for.
An invokable class can be used for all the same things as any other callable - I've seen them used for event handlers, middleware, comparison for sorting, and so on.
When you spotted those, were they also with such a generic invocable interface as in this idea in their interface hierarchy?

« previous php.internals (#130491) next »