<?php
interface a {
public function bar();
}
interface b extends a {
public function foo();
public function bar($a);
}
?>
It is showing a fatal error of signature missmatch in method. is not it possible to override a method of interface in php?
You're getting the signature mismatch error because the two bar functions aren't compatible.
You can fix it by changing the interface to
interface b extends a {
public function foo();
public function bar($a = null);
}
Although this might not be a complete solution, as you will now get a Can't inherit abstract function error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With