Re: [RFC] Default constructors
| From: | Stanislav Malyshev | Date: | Wed, 19 Nov 2014 01:50:33 +0000 |
| Subject: | Re: [RFC] Default constructors | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-78976@lists.php.net to get a copy of this message | ||
Hi!
> Is there a
.phpt test-case or discussion backing this?
Backing what? Checking if side effects happen when evaluating args of
non-existing ctor? Probably not, since nobody ever needed it (correct me
if I'm wrong). There are many weird scenarios of what you could do with
PHP that are not covered by tests because nobody ever thought anybody
would care to know what happens if you do that.
But I don't need tests to conclude it's intentional behavior - plain
look at the code shows it very clearly, you don't make special case in
ZEND_NEW to skip the ctor method call and write all the code around it
if you don't mean to make special case to do just that.
> I find this quite hard to believe, especially since following examples
> are broken in php and working "as expected" (by me) in hhvm:
> http://3v4l.org/4nhoq
>
> Yes, that's a bug :-)
No, it is not :)
We can do it all day but I think I've explained what is going on there.
If you want to change it, feel free to do the RFC.