PHP is not allowed if there are multiple interfaces that have an identical method name and are not inherited
The following example:
php; " >
Interface a{
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 () (previously 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";
}
}
http://www.bkjia.com/PHPjc/371991.html www.bkjia.com true http://www.bkjia.com/PHPjc/371991.html techarticle If there are multiple interfaces that have an identical method name and are not inherited, PHP is not allowed for the following instance: PHP; interface a{public function x ();} interface b{public function x () ... /c5>