Doc #51664 [NEW]: Interfaces page gives unclear information about class constants
| From: | chris at cmbuckley dot co dot uk | Date: | Mon, 26 Apr 2010 09:08:10 +0000 |
| Subject: | Doc #51664 [NEW]: Interfaces page gives unclear information about class constants | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-4237@lists.php.net to get a copy of this message | ||
From:
Operating system: Irrelevant
PHP version: Irrelevant
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:Interfaces page gives unclear information about class constants
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 bug report at http://bugs.php.net/bug.php?id=51664&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=51664&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=51664&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=51664&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=51664&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51664&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=51664&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=51664&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=51664&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=51664&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=51664&r=support
Expected behavior: http://bugs.php.net/fix.php?id=51664&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=51664&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=51664&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=51664&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51664&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=51664&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=51664&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=51664&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=51664&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=51664&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=51664&r=mysqlcfg