Req #71271 [NEW]: Allow final abstract class {}
| From: | andreas at dqxtech dot net | Date: | Mon, 04 Jan 2016 05:21:17 +0000 |
| Subject: | Req #71271 [NEW]: Allow final abstract class {} | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-198389@lists.php.net to get a copy of this message | ||
From: andreas at dqxtech dot net
Operating system:
PHP version: 7.0.2RC1
Package: Class/Object related
Bug Type: Feature/Change Request
Bug description:Allow final abstract class {}
Description:
------------
It should be allowed to make a class both final and abstract, to make it
a place for static methods. There is no good reason to not allow this.
It is already possible to achieve the same or a similar effect with
final + a private constructor. But this is unnecessarily verbose.
Test script:
---------------
<?php
abstract final class C {
static function foo() {}
}
Expected result:
----------------
should work just fine.
Actual result:
--------------
Fatal error: Cannot use the final modifier on an abstract class
--
Edit bug report at https://bugs.php.net/bug.php?id=71271&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71271&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71271&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71271&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=71271&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=71271&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=71271&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=71271&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=71271&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=71271&r=support
Expected behavior: https://bugs.php.net/fix.php?id=71271&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=71271&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=71271&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=71271&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71271&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=71271&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=71271&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=71271&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71271&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=71271&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=71271&r=mysqlcfg