On Feb 27, 2004, at 4:12 AM, Andi Gutmans wrote:
Hey,
I'd like to come to some conclusion about the latest changes which break BC (trying to keep it short because some people here wrote long essays and it took me too much time to catch up :) :
a) I agree that it doesn't make much sense for constructors, because one always creates concrete classes.
To play devil's advocate, If I'm creating objects through a factory, the unified constructor signature is very helpful.
d) Last problem is that using E_STRICT is not a good idea because we find this problem at compile-time and the error_reporting might not be set yet.
PHP is plagued with this problem though (if you consider it a problem, I think it's a feature). This is not the only warning in PHP that is suppressed at compile time if your error settings aren't set correctly.
What I suggest is the following: a) Don't check signature for constructors.
I like that.
b) By default, don't check signature for inheritance *if* we're not inheriting from an abstract class. If it is an abstract class we should check the signature because it's a PHP 5 feature.
I'm iffy on that, but it's certainly better than the current situation.
c) Add a new INI option (zend.strict_inheritance_checks) which does check signature for methods (except for constructor). I don't like new INI options but I don't think there's any way out.
I prefer E_STRICT warnings unconditionally. The new ini suffers from all the issues ini settings do (hinders portable code).
George
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php