Doc #51664 [Csd]: Interfaces page gives unclear information about class constants
| From: | degeberg@php.net | Date: | Mon, 26 Apr 2010 16:50:44 +0000 |
| Subject: | Doc #51664 [Csd]: Interfaces page gives unclear information about class constants | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-4243@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: Closed
Type: Documentation Problem
Package: Documentation problem
Operating System: Irrelevant
PHP Version: Irrelevant
Assigned To: degeberg
New Comment:
Oh, sorry. I hadn't noticed that comment. That sentence has been removed
now.
Thanks again :)
Previous Comments:
------------------------------------------------------------------------
[2010-04-26 18:50:09] degeberg@php.net
Automatic comment from SVN on behalf of degeberg
Revision: http://svn.php.net/viewvc/?view=revision&revision=298604
Log: Another fix for #51664 (Interfaces page gives unclear information
about class constants)
------------------------------------------------------------------------
[2010-04-26 18:32:43] chris at cmbuckley dot co dot uk
Initial fix addresses documentation text but the following comment in
Example #4 still remains:
// This will however not work because its not allowed to
// override constants. This is the same concept as with
// class constants
IMHO this still leaves room for confusion.
------------------------------------------------------------------------
[2010-04-26 18:27:02] degeberg@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.
------------------------------------------------------------------------
[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