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

Reply via email to