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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux