FAQ

On 16 May 2016 at 10:31, Dmitry Stogov 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/

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 5 of 7 | next ›
Discussion Overview
groupphp-internals @
categoriesphp
postedMay 15, '16 at 5:29p
activeMay 16, '16 at 8:12p
posts7
users5
websitephp.net

People

Translate

site design / logo © 2019 Grokbase