Interface Implemented Too Low

<?php

interface i {
    function foo($a, $b);
}

class x {
    function foo() {}
}

class y extends x implements i {
    function foo($a = 1) {}
}

An interface’s signatures applies only to the current class and its children. It means that the parent do not have to use the same signature.

Although, the parent and the child must use a compatible signature, indepdently from the interface. And, in the end, the child signature must be compatible with both the parent and the interface.

While it may be convenient to use the interface on a single child and not on its siblings, it might be less surprising to use the interface on the parent directly. Unless it does not have such a method.

See Also

PHP Features

Last updated: 15 July 2026