Is an E_STRICT warning when overwriting a static method with a differentparameter list desired?

Is an E_STRICT warning when overwriting a static method with a differentparameter list desired?

am 21.09.2009 01:36:08 von Martijn Evers

Hi,

I was wondering if an E_STRICT error is desired when a static method is
overwritten with a other parameter list.

The error I'am getting is:
"Strict Standards: Declaration of Sub::doSomething() should be
compatible with that of Base::doSomething()"

When I run this code:
------------------------------------------------------------ ---------------
class Base
{
public static function doSomething($something)
{
echo $something;
}
}

class Sub extends Base
{
public static function doSomething()
{
parent::doSomething('anything');
}
}


But why? Aren't interfaces supposed to handle this?

NOTE: Be sure to have E_STRICT enabled in the ini or a file including
this one. E_STRICT errors are not reported in the file where
error_reporting is used to set E_STRICT. (personal experience :P )

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php