#33698 [Opn->Bgs]: Conflicts with multiple interfaces sharing common method names

From: Date: Fri, 15 Jul 2005 10:44:05 +0000
Subject: #33698 [Opn->Bgs]: Conflicts with multiple interfaces sharing common method names
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-81893@lists.php.net to get a copy of this message
ID: 33698 Updated by: sniper@php.net Reported By: jason at hybd dot net -Status: Open +Status: Bogus Bug Type: Scripting Engine problem Operating System: * PHP Version: 5.0.4 New Comment: PHP != Java Previous Comments: ------------------------------------------------------------------------ [2005-07-14 17:35:15] jason at hybd dot net Description: ------------ This is debateable if this is a bug or not. Personally, I don't regard it as a bug. Classes that implement >1 interface that share common methods raise fatal errors. Because of the abstract nature of interfaces, no error or warning should be rasied. I know PHP <> Java, but Java doesn't raise any errors, and PHP5's OO model is very close to Java's Reproduce code: --------------- interface FirstInterface { function execute(); } interface SecondInterface { function execute(); } class MyClass implements FirstInterface, SecondInterface { function execute() { echo "Hello World"; } } $obj = new MyClass(); $obj->execute(); Expected result: ---------------- Hello World Actual result: -------------- Can't inherit abstract function SecondInterface::execute() ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=33698&edit=1

« previous php.bugs (#81893) next »