note 102803 deleted from language.oop5.interfaces by danbrown

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
Note Submitter: lpu8er at noSpam dot gmail dot com 

----

To thanhn2001 at gmail dot com :

Neither a bug nor a feature, it is because of the main functionality of interfaces. If you inherits a class B to a A, with A which implements an interface iInterface, B is not implementing it.

For example:
<?php
  interface iMy {
    public function king();
  }

  class A implements iMy {
    public function king() {  } // otherwise, Fatal Error
  }

  class B extends A { } // no Fatal Error
?>

But if you explicitely ask an implement of iMy in B...

<?php
  interface iMy {
    public function king();
  }

  class A implements iMy {
    public function king() {  } // otherwise, Fatal Error
  }

  class B extends A implements iMy { } // Fatal Error
?>

So, in your case, there is no "overwrite".
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.