From: cscott at ggot dot org Operating system: Irrelevant PHP version: 5.2.9 PHP Bug Type: Feature/Change Request Bug description: Allow 'static' keyword to be applied to entire classes
Description: ------------ Fairly simple: A developer is allowed to define his/her classes as abstract or final, but not as static. For continuity's sake, it would be preferable to be able to declare classes as static as well. This would greatly ease the creation of static function collections/libraries, especially those included with __autoload(). When a class is declared as abstract, it is a statement at the open that this is an incomplete member; you can specify any method inside a class to be abstract and the class is effectively abstract, yet this keyword is allowed in the class declaration. When a class is declared final, it is a statement at the open that all members are to be considered final, and that this class should not be extended any further. By allowing classes to be declared as static, it would follow with allowing "abstract class foo" in the sense that the keyword reflects the contents of the class, and would follow with "final class foo" in that it would define a binding construct for all members of the class. Whether a) In a static class, all methods and members are automatically static -OR- b) In a static class, all methods and members must be declared static Is surely not for me to decide -- either is useful, as it either forces me to ensure all members are static, or it does the legwork for me. As such, I make no suggestion and defer to the wisdom of the developer(s). Thank you for your consideration. -- Edit bug report at http://bugs.php.net/?id=47971&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=47971&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=47971&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=47971&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=47971&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=47971&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=47971&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=47971&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=47971&r=needscript Try newer version: http://bugs.php.net/fix.php?id=47971&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=47971&r=support Expected behavior: http://bugs.php.net/fix.php?id=47971&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=47971&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=47971&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=47971&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47971&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=47971&r=dst IIS Stability: http://bugs.php.net/fix.php?id=47971&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=47971&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=47971&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=47971&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=47971&r=mysqlcfg