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/
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php