Timm Friebe wrote:

[EMAIL PROTECTED]:~/devel/php/tests > cat inheritance.php <?php
class Foo {
function __construct($foo) {
}
}
class Bar extends Foo {
function __construct($foo, $bar) { // Add = NULL after $bar to make it work
}
}
?>
[EMAIL PROTECTED]:~/devel/php/tests > php-dev inheritance.php


Fatal error: Declaration of Bar::__construct() must be compatible with
that of Foo::__construct() in
/usr/home/thekid/devel/php/tests/inheritance.php on line 10

Is this really necessary?
If that error still occurs if you explicitely call the parent's __construct (from the derived __construct), that's a bug IMO.

It's totally understandable to get such an error message in the case the parent constructor gets called implicitely, but for an explicit call there should neither be a warning or an error .

Cheers,
Michael

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



Reply via email to