Ich versuche zu implementieren eine Schnittstelle zweimal implementieren, die eine andere Schnittstelle, aber nicht in der Lage erstreckt, um herauszufinden, warum ich ein Fatal ErrorPHP - kann nicht die gleiche Schnittstelle zweimal
Hier ist mein Code bin immer:
interface a {
public function foo();
}
interface b extends a {
public function baz(Baz $baz);
}
// This will work
class c implements b {
public function foo() {
}
public function baz(Baz $baz) {
}
}
// This will not work and result in a fatal error
class d implements b {
public function foo() {
}
public function baz(Foo $foo) {
}
}
ich erhalte diese Fehlermeldung:
Fatal error: Erklärung d :: baz() muss mit b :: baz (Baz $ baz) in K kompatibel sein: \ xampp \ htdocs \ oop \ Lec 2 \ index.php auf der Linie 26
Dank @Erik ich habe es. – luckyali444