php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #65246 Discrepancy between documentation and actual workings
Submitted: 2013-07-11 19:52 UTC Modified: 2013-07-21 14:37 UTC
From: bernardo at thebigb dot nl Assigned: aharvey (profile)
Status: Closed Package: Documentation problem
PHP Version: 5.3.27 OS: Debian GNU/Linux 7 (wheezy)
Private report: No CVE-ID: None
 [2013-07-11 19:52 UTC] bernardo at thebigb dot nl
Description:
------------
The actual PHP version I am using is PHP 5.4.4-14+deb7u2.

The issue is regarding this doc page:
http://www.php.net/manual/en/language.oop5.interfaces.php

More specifically the statement: "Note: A class cannot implement two interfaces 
that share function names, since it would cause ambiguity."

This statement is incorrect, as I have discovered in my PHP environment that the 
test below executes without errors or warnings.

I tracked the change in the documented behavior down to the following commit:
https://github.com/php/php-
src/commit/31ef559712dae57046b6377f07634ad57f9d88cf#Zend/zend_compile.c

That would mean that the note is not relevant anymore since php-5.3.9.

Test script:
---------------
interface Foo
{
	public function sameMethod();
}

interface Bar
{
	public function sameMethod();
}

class Baz implements Foo, Bar
{
	public function sameMethod()
	{
		echo 'Something';
	}
}

$obj = new Baz();
$obj->sameMethod();


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-07-21 14:37 UTC] aharvey@php.net
Automatic comment from SVN on behalf of aharvey
Revision: http://svn.php.net/viewvc/?view=revision&revision=330996
Log: Document the change in inheritance behaviour in PHP 5.3.9 when conflicting
method names share a signature.

Fixes doc bug #65246 (Discrepancy between documentation and actual workings).
 [2013-07-21 14:37 UTC] aharvey@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: aharvey
 [2013-07-21 14:37 UTC] aharvey@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 06:00:01 2026 UTC