On 26/02/2016 11:28, Andrea Faulds 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
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 o
On Fri, 26 Feb 2016 14:28:19 +0300, Andrea Faulds wrote:
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
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 wo
Hi Adam,
Adam Harvey wrote:
On 25 February 2016 at 09:40, Andrea Faulds wrote:
Instead of changing __construct to implicitly create the object it acts on
in certain contexts, I would suggest a simpler approach: add a magic ::new()
static method that exists on all classes (think ::class, althou
On 25/02/2016 17:40, Andrea Faulds wrote:
Dan Ackroyd wrote:
I've written a small RFC to make it possible to call constructors of
objects as a callable, rather than only being able to call them
through the 'new' language construct.
https://wiki.php.net/rfc/callableconstructors
While I like th
On 25 February 2016 at 09:40, Andrea Faulds wrote:
> Instead of changing __construct to implicitly create the object it acts on
> in certain contexts, I would suggest a simpler approach: add a magic ::new()
> static method that exists on all classes (think ::class, although that is a
> constant).
Hi Dan,
Dan Ackroyd wrote:
I've written a small RFC to make it possible to call constructors of
objects as a callable, rather than only being able to call them
through the 'new' language construct.
https://wiki.php.net/rfc/callableconstructors
While I like the concept, I dislike the execution