On 16 May 2016 at 09: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? >
Hi Dmitry, Several small to medium sized reasons that make me think it's the best way. As Marco said, constructors cannot be passed as callbles, which for whatever reason both myself and he seem to encounter as a problem more than the average programmer. I had hoped to address this with this RFC: https://wiki.php.net/rfc/callableconstructors - but the feedback on that was massively negative so far. Second, it's quite likely we're going to have other ways of creating closures in the future. Having a default constructor that is 'special' above the other named constructors is a source of API sadness for me. > would look more readable than I actually seem to like named constructors more than default constructors, and am totally used to reading them. That may be down to my dislike of how constructors have special rules in being a little bit static, and also being instance methods at the same time. cheers Dan -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php