declaring classes as static or final
| From: | Michael Virnstein | Date: | Tue, 28 Sep 2004 12:45:40 +0000 |
| Subject: | declaring classes as static or final | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-13047@lists.php.net to get a copy of this message | ||
Hi Devs,
what would probably be a nice addition:
1. static classes:
static classes can only contain static methods and attributes
<?php
static class foo {
public static function bar() {}
}
?>
2. final classes:
final classes can't be extended
final class foo {
public function bar() {}
}
3. final static classes
final static classes can only contain static methods and attributes and can't be extended.
final static class foo {
public static function bar() {}
}
What do you think about it?