View Single Post
  #4 (permalink)  
Old June 16th, 2005, 04:56 AM
Nimmit Nimmit is offline
Registered User
 
Join Date: Jun 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

can someone please clarify whether or not the previous example is a valid use for interfaces or not?

I had the same problem in chapter two!!

Code:
interface Musician {
     public function addInstrument();
     public function getInstruments();

     public function assignToBand();
     public function getMusicianType();
  }
Gave me this error
Fatal error: Declaration of Guitarist::addInstrument() must be compatible with that of Musician::addInstrument()

Code:
interface Musician {
     public function addInstrument(Instrument $instument);
     public function getInstruments();

     public function assignToBand(Band $band);
     public function getMusicianType();
  }
Seems to work

Is this correct ??

Thank

Sam