Doc #73259 [Asn->Csd]: Documentation for interfaces doesn't mention LSP
| From: | pasindu@php.net | Date: | Sun, 10 Feb 2019 23:45:48 +0000 |
| Subject: | Doc #73259 [Asn->Csd]: Documentation for interfaces doesn't mention LSP | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-16393@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=73259&edit=1
ID: 73259
Updated by: pasindu@php.net
Reported by: phansys at gmail dot com
Summary: Documentation for interfaces doesn't mention LSP
-Status: Assigned
+Status: Closed
Type: Documentation Problem
Package: Class/Object related
Operating System: any
PHP Version: Irrelevant
Assigned To: girgias
Block user comment: N
Private report: N
New Comment:
The fix for this bug has been committed.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
For Windows:
http://windows.php.net/snapshots/
Thank you for the report, and for helping us make PHP better.
http://svn.php.net/viewvc?view=revision&revision=346783
Previous Comments:
------------------------------------------------------------------------
[2019-01-20 17:56:54] girgias@php.net
The following patch has been added/updated:
Patch Name: doc-fix-73259
Revision: 1548007014
URL: https://bugs.php.net/patch-display.php?bug=73259&patch=doc-fix-73259&revision=1548007014
------------------------------------------------------------------------
[2016-10-06 15:30:05] phansys at gmail dot com
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 this bug report at https://bugs.php.net/bug.php?id=73259&edit=1