On 16 May 2016 at 10:31, Dmitry Stogov <dmi...@zend.com> wrote: > I'm sorry, I didn't follow the RFC discussion. > In general I like the idea, but why not to use Closure constructor? > > $f = new Closure("some_func"); > > would look more readable than > > $f = Closure::fromCallable("some_func"); > > Sorry, if this was already discussed before. > > Thanks. Dmitry. >
Constructors can't be used as callbacks, so you wouldn't be able to map this operation without yet another level of indirection. A named constructor also leaves more space for later improvements, and is quite a bit more expressive. Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/