Dmitry Stogov wrote on 24/11/2014 09:56:
However, I thought about one more inconsistent. Your patch works fine for
"parent::" methods but not for "grandparents::"
In the following code "default constructor" won't work.

class A {
}
class B extends A {
}
class C extends B {
   function __constructor() {
     A::_constructor(); // this won't work
   }
}

I guess some inconsistency like this is hard to avoid unless the default constructor is actually added to the class's method table, because the code has to specifically check for each case that is to be supported.

At risk of flogging a dead horse, this is why I was arguing for the lazy evaluation with new keyword to be abandoned, because it seems like that's the primary compatibility issue with adding a "real" default definition. Reflection would show the method as either "internal" or inherited from some implicit base class.

From a user's point of view there should really be no difference between "no constructor" and "constructor which does nothing", IMHO.

Regards,
--
Rowan Collins
[IMSoP]

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

Reply via email to