Doc #51664 [Opn->Csd]: Interfaces page gives unclear information about class constants

From: Date: Mon, 26 Apr 2010 16:27:02 +0000
Subject: Doc #51664 [Opn->Csd]: Interfaces page gives unclear information about class constants
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-4241@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=51664&edit=1 ID: 51664 Updated by: degeberg@php.net Reported by: chris at cmbuckley dot co dot uk Summary: Interfaces page gives unclear information about class constants -Status: Open +Status: Closed Type: Documentation Problem Package: Documentation problem Operating System: Irrelevant PHP Version: Irrelevant -Assigned To: +Assigned To: degeberg New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [2010-04-26 18:26:52] degeberg@php.net Automatic comment from SVN on behalf of degeberg Revision: http://svn.php.net/viewvc/?view=revision&revision=298601 Log: Fixed PHP bug #51664 (Interfaces page gives unclear information about class constants) ------------------------------------------------------------------------ [2010-04-26 11:08:09] chris at cmbuckley dot co dot uk Description: ------------ There are two cases on the interfaces documentation page that give misleading information about class constants, by saying that interface constants have the same behaviour as class constants in that they cannot be overridden by an inheriting class. This is true of interfaces, but not of classes. The offending text appears in the "Constants" section (http://php.net/interfaces#language.oop5.interfaces.constants) and in the comments in Example #4. Test script: --------------- class a { const t = 'foo'; } class b extends a { const t = 'bar'; } echo b::t; // 'bar' interface i { const t = 'foo'; } class c implements i { const t = 'bar'; } // Fatal: cannot override ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=51664&edit=1

« previous php.doc.bugs (#4241) next »