On 18/11/14 14:00, Stanislav Malyshev wrote:
Hi!
Thanks for bringing this up and working on the patch.
Last time we discussed
this(http://www.serverphorums.com/read.php?7,712222,712635), there were
a couple of people including Anthony and Sanford who were agains this
feature arguing that it would encourage bad practices so I think it
Obviously, I disagree with that. I do not see any bad practices it
encourages - if anything, it encourages the good practice of always
calling parent ctor, practice considered so good by many that some
languages make it mandatory.
However, Java lets one have as many constructors as one wants because
Java supports overloading and there's a default constructor that takes
no arguments.
Does it *really* make sense for PHP? What if that parent class 'Animal'
from your example introduces a constructor that accepts, say, both
`$owner` and `$what` as mandatory arguments? `parent::__construct()`
call in a descendant will appear broken (unintentionally, I suppose),
won't it? That'll work in Java just fine, though.
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php