Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91433 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 81408 invoked from network); 26 Feb 2016 11:28:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Feb 2016 11:28:23 -0000 X-Host-Fingerprint: 178.62.40.5 ajf.me Received: from [178.62.40.5] ([178.62.40.5:3484] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C0/D2-55238-7D630D65 for ; Fri, 26 Feb 2016 06:28:23 -0500 Message-ID: To: internals@lists.php.net References: <97.82.11730.D8C3FC65@pb1.pair.com> <56CF63D8.8020005@gmail.com> Date: Fri, 26 Feb 2016 11:28:19 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:42.0) Gecko/20100101 Firefox/42.0 SeaMonkey/2.39 MIME-Version: 1.0 In-Reply-To: <56CF63D8.8020005@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 178.62.40.5 Subject: Re: [PHP-DEV] Re: [RFC] Callable constructors From: ajf@ajf.me (Andrea Faulds) Hi Rowan, Rowan Collins wrote: > On 25/02/2016 17:40, Andrea Faulds wrote: > > Snipped for brevity, but I agree with your sentiment here. Making > __construct more magic seems like an imperfect solution to this. I'm not > sure making a new magic method (new, __new, etc) is much better though, > since it would serve such a limited purpose. Yeah, I do wonder if ::new would really be worth it. > > Then we could add to that a special case for constructors: > > - Callable::forConstructor(string $class_name) > Oh, that's quite a clean solution, I like that. Heck, no need for Callable, we already have ->getClosure() in Reflection. A modified version of that for constructors could work (ReflectionClass::getConstructorClosure() ?). Thanks. -- Andrea Faulds https://ajf.me/