PHP Strict Standards: Declaration of uploaded::Download() should be compatible with DownloadClass::Download [closed]

StackOverflow https://stackoverflow.com/questions/18134235

  •  24-06-2022
  •  | 
  •  

Вопрос

I just open this topic because i'm trying to figure this out for days....

Error_log [08-Aug-2013 14:57:37 UTC] PHP Strict Standards: Declaration of uploaded::Download() should be compatible with DownloadClass::Download($link, $FileName, $cookie = 0, $post = 0, $referer = '', $caching = false) in /home/srv26/public_html/hosts/uploaded.class.php on line 3

Line 3:

final class uploaded extends DownloadClass implements Hosts {

Does anyeone have any idea of this error? Thanks for all! =)

final class uploaded extends DownloadClass implements Hosts {
    public static function Download($link, $caching = false) {
        parent::Download($Frag, '', $Cookies, 0, '', $caching);
    }
}


abstract class DownloadClass extends cmmf {
    protected static function Download($link, $FileName, $cookie = 0, $post = 0, $referer = '', $caching = false){
        [..........]
    }
}

uploaded.class The file is like this...

final class uploaded extends DownloadClass implements Hosts {
    public static function Download($link, $caching = false) {
        parent::Download($Frag, '', $Cookies, 0, '', $caching);
    }
}

DownloadClass

abstract class DownloadClass extends cmmf {
    protected static function Download($link, $FileName, $cookie = 0, $post = 0, $referer = '', $caching = false){
        [..........]
    }
}
Это было полезно?

Решение

Easy thing:

The two definitions of the Download function differ.

Make them the same.

The point of extending an abstract class is that the abstract class sets the template for ALL methods that any child class might have, so that it does not matter for any consuming code to check WHICH incarnation of child class it has to deal with.

So you wanted to have a shortcut parameter list that gets filled with defined default variables. That will work only if you create a new function name. If you are using the same function name, that error will stay.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top