Re: [RFC] Default constructors

From: Date: Tue, 18 Nov 2014 14:19:14 +0000
Subject: Re: [RFC] Default constructors
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-78944@lists.php.net to get a copy of this message
Andrea Faulds wrote on 18/11/2014 13:11:
On 18 Nov 2014, at 12:47, Ferenc Kovacs <tyra3l@gmail.com> wrote: On Tue, Nov 18, 2014 at 1:35 PM, Ivan Enderlin @ Hoa < ivan.enderlin@hoa-project.net> wrote:
Hello :-), Is it not simpler to create a super-object whom all objects are children of? Something similar to the Java Object?
yeah, this was also a suggested alternative when discussing this problem previously(see the link in my previous mail).
I'd certainly like it if everything descended from some class (Object? StdClass?), but I don't like the idea of an empty construct. As Anthony pointed out last time, you can't do inheritance and simultaneously treat the parent class as a black box.
The thing is that without any way of monkey-patching the default object, there isn't much difference between "all objects have a default constructor" and "all objects have a default parent", other than "$foo instanceOf Object" always returning true. Regards, -- Rowan Collins [IMSoP]

« previous php.internals (#78944) next »