php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71871 Interfaces allow final and abstract functions
Submitted: 2016-03-21 15:40 UTC Modified: 2016-03-21 21:42 UTC
From: temp at temp dot ru Assigned:
Status: Closed Package: *General Issues
PHP Version: 7.0.4 OS:
Private report: No CVE-ID:
 [2016-03-21 15:40 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-03-21 21:30 UTC] requinix@php.net
-Status: Open +Status: Wont fix
 [2016-03-21 21:30 UTC] 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 21:36 UTC] nikic@php.net
-Status: Wont fix +Status: Open
 [2016-03-21 21:36 UTC] 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:42 UTC] requinix@php.net
...oops.
 [2016-03-21 21:50 UTC] nikic@php.net
Automatic comment on behalf of nikic
Revision: http://git.php.net/?p=php-src.git;a=commit;h=dc842bbf8d8c8e4c244bfae6dd23e3d461b4cbc9
Log: Fixed bug #71871
 [2016-03-21 21:50 UTC] nikic@php.net
-Status: Open +Status: Closed
 [2016-07-20 11:32 UTC] davey@php.net
Automatic comment on behalf of nikic
Revision: http://git.php.net/?p=php-src.git;a=commit;h=dc842bbf8d8c8e4c244bfae6dd23e3d461b4cbc9
Log: Fixed bug #71871
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Mon May 29 04:01:35 2017 UTC