Doc #73259 [NEW]: Documentation for interfaces doesn't mention LSP
| From: | phansys at gmail dot com | Date: | Thu, 06 Oct 2016 15:30:07 +0000 |
| Subject: | Doc #73259 [NEW]: Documentation for interfaces doesn't mention LSP | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-13995@lists.php.net to get a copy of this message | ||
From: phansys at gmail dot com
Operating system: any
PHP version: Irrelevant
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:Documentation for interfaces doesn't mention LSP
Description:
------------
http://php.net/manual/en/language.oop5.interfaces.php#language.oop5.interfaces
states in a note:
"The class implementing the interface must use the exact same method
signatures as are defined in the interface. Not doing so will result in
a fatal error."
Which doesn't seem to mention LS principle in any way. For more
information, check https://bugs.php.net/bug.php?id=73220.
Test script:
---------------
interface A
{
public function test($one = null);
}
class B implements A
{
public function test($one = null, $two = null)
{
var_dump($one, $two);
}
}
Expected result:
----------------
Fatal error: Declaration of B::test($one, $two) must be compatible with
A::test($one = NULL)
Actual result:
--------------
No error.
--
Edit bug report at https://bugs.php.net/bug.php?id=73259&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73259&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73259&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73259&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=73259&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=73259&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=73259&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=73259&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=73259&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=73259&r=support
Expected behavior: https://bugs.php.net/fix.php?id=73259&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=73259&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=73259&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=73259&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73259&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=73259&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=73259&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=73259&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=73259&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=73259&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=73259&r=mysqlcfg