On 26/02/2016 11:47, Nikita Nefedov wrote:
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.
Hey Andrea,
This would still not solve Dan's problem though. Which is representing
`new Class` as a serializeable callable.
There are lots of types of callable which can't be serialized already -
anonymous functions, invokable objects, instance methods - so I'm still
not convinced why this particular one is so important. Anything that can
only take its callback as a string already rejects many things that are
otherwise callable, so I'm not sure why having to reject a wrapped
constructor is so much worse that it needs a new language concept.
Regards,
--
Rowan Collins
[IMSoP]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php