Bug #76000 [Csd->Dup]: Unable to annotate more specific return types in PHP 7.1
| From: | cmb@php.net | Date: | Fri, 23 Feb 2018 17:22:24 +0000 |
| Subject: | Bug #76000 [Csd->Dup]: Unable to annotate more specific return types in PHP 7.1 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-214088@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76000&edit=1
ID: 76000
Updated by: cmb@php.net
Reported by: bexomixog at 69postix dot info
Summary: Unable to annotate more specific return types in PHP
7.1
-Status: Closed
+Status: Duplicate
Type: Bug
Package: *General Issues
PHP Version: 7.1.14
Assigned To: cmb
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2018-02-23 17:15:17] cmb@php.net
Duplicate of feature request #72442.
------------------------------------------------------------------------
[2018-02-23 17:05:50] bexomixog at 69postix dot info
Description:
------------
Good evening. I think the following code should be allowed.
Test script:
---------------
<?php
class ParentClass
{
}
class ChildClass extends ParentClass
{
}
class A
{
public function test() : ParentClass{}
}
class B extends A
{
public function test() : ChildClass{}
}
Expected result:
----------------
No error.
Actual result:
--------------
Fatal error: Declaration of B::test(): ChildClass must be compatible with A::test(): ParentClass
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76000&edit=1