Bug #71871 [Opn->Csd]: Interfaces allow final and abstract functions
| From: | nikic@php.net | Date: | Mon, 21 Mar 2016 21:50:17 +0000 |
| Subject: | Bug #71871 [Opn->Csd]: Interfaces allow final and abstract functions | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-200011@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=71871&edit=1
ID: 71871
Updated by: nikic@php.net
Reported by: temp at temp dot ru
Summary: Interfaces allow final and abstract functions
-Status: Open
+Status: Closed
Type: Bug
Package: *General Issues
PHP Version: 7.0.4
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of nikic
Revision: http://git.php.net/?p=php-src.git;a=commit;h=dc842bbf8d8c8e4c244bfae6dd23e3d461b4cbc9
Log: Fixed bug #71871
Previous Comments:
------------------------------------------------------------------------
[2016-03-21 21:42:11] requinix@php.net
...oops.
------------------------------------------------------------------------
[2016-03-21 21:36:22] nikic@php.net
@requinix: That's what the bug report is about. Before PHP 7 these things were forbidden, with
PHP 7 they no longer throw an error. See https://3v4l.org/VetUB
------------------------------------------------------------------------
[2016-03-21 21:30:59] requinix@php.net
Interfaces describe behavior. It does not make sense for them to dictate matters of implementation
like whether a method is final or abstract.
------------------------------------------------------------------------
[2016-03-21 15:40:15] temp at temp dot ru
Description:
------------
PHP 7 allows interfaces with final and abstract methods.
Test script:
---------------
<?php
interface test
{
final function test1();
abstract function test2();
}
Expected result:
----------------
Fatal error: Access type for interface method test::test1() must be omitted in /in/vqFDT on line 5
When the first mistake is fixed, then
Fatal error: Access type for interface method test::test2() must be omitted in /in/vqFDT on line 6
Actual result:
--------------
no errors
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71871&edit=1