Mailinglisten-Archive | 
Hallo Leute,
folgendes Beispiel:
<?php
interface A {
   public function foo(A $obj);
}
abstract class B implements A {
   public function foo(A $obj) {
   }
}
class C extends B {}
$c = new C();
?>
($c instanceof A) ==> true
($c instanceof B) ==> true
($c instanceof C) ==> true
Soweit alles klar - aber nun mein Problem:
Warum liefert
abstract class B implements A {
   public function foo(B $obj) {
   }
}
die Fehlermeldung "Fatal error: Declaration of B::foo() must be
compatible with that of A::foo()"?
B ist doch sehrwohl auch vom Typ A, also hab ich das Interface korrekt
implementiert - zumindest nach meinem Verständnis der OOP.
Ist das schon einmal jemandem aufgefallen? Ist das ein Fehler oder ein
Feature? Wenn zweiteres - was für Sinn soll das machen ?!
Liebe Grüße
Hannes Halenka
    php::bar PHP Wiki - Listenarchive