Multiple PHP interfaces use the same method. If multiple interfaces have the same method name and are not inherited, PHP does not allow the following instances: php; interfacea {publicfunctionx ();} interfaceb {publicfunctionx () if multiple interfaces have the same method name and are not inherited, PHP is not allowed.
Example:
Php; ">
Interface {
Public function x ();
}
Interface B {
Public function x ();
}
Class c implements a, B {
Public function x ();
}
The following error is reported: Can't inherit abstract function B: x () (previusly declared abstract in c)
If you want to implement different interfaces with the same method, you can implement the following:
Php; ">
Interface d {
Public function x ();
}
Interface a extends d {}
Interface B extends d {}
Class c implements a, B {
Public function x (){
Echo "succ ";
}
}
Example: php; interface a {public function x ();} interface B {public function x ()...