Bug #71871 [Wfx->Opn]: Interfaces allow final and abstract functions

From: Date: Mon, 21 Mar 2016 21:36:23 +0000
Subject: Bug #71871 [Wfx->Opn]: Interfaces allow final and abstract functions
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-200009@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: Wont fix +Status: Open Type: Bug Package: *General Issues PHP Version: 7.0.4 Block user comment: N Private report: N New Comment: @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 Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#200009) next »