On Fri, Nov 21, 2014 at 11:20 AM, Levi Morrison <le...@php.net> wrote:
>> BTW, old constructor has problem with traits (is this mentioned already?)
>>
>> http://3v4l.org/KZKXo
>>
>> I suppose nobody is using this side effect in production code, but
>> there would be number of users who are confused by this behavior.
>
> If I remember the source code correctly, this should be considered a
> bug. I will definitely look into this, regardless of the outcome of
> this RFC.

It turns out I was incorrect; based on the code and the phpt tests I
would not say this is a bug.

However, traits do check for "colliding constructors" and emit a fatal
error when having both a method named after the class and a
__construct method: http://3v4l.org/YHAtA. Note that it doesn't matter
who declares the old and new style constructors:
http://3v4l.org/ZOeoY. When defining only the same style of
constructor in both there is no error: http://3v4l.org/H1jG1 and
http://3v4l.org/m5D7p.

I will lift this restriction in the RFC for both PHP 5.7 and 7 and
update the implementation when I can.

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to