Cannot implement two interfaces that have the same method name

后端 未结 5 1986
[愿得一人]
[愿得一人] 2021-01-13 07:28

This doesn\'t work:

interface TestInterface
{
    public function testMethod();
}

interface TestInterface2
{
    public function testMethod();
}

class Test         


        
5条回答
  •  无人共我
    2021-01-13 07:58

    It appears that current PHP versions actually can do this. I've tracked the change in behavior down to this commit:

    https://github.com/php/php-src/commit/31ef559712dae57046b6377f07634ad57f9d88cf#Zend/zend_compile.c

    So as of php-5.3.9 the documented behavior appears to have changed.

提交回复
热议问题