#30250 [Opn]: final keyword for class variables?
| From: | derick@php.net | Date: | Mon, 27 Sep 2004 07:09:31 +0000 |
| Subject: | #30250 [Opn]: final keyword for class variables? | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969364290@lists.php.net to get a copy of this message | ||
ID: 30250
Updated by: derick@php.net
Reported By: nut at phpnut dot com
Status: Open
-Bug Type: Class/Object related
+Bug Type: Documentation problem
Operating System: Linux
PHP Version: 5.0.1
New Comment:
docs are wrong.
Previous Comments:
------------------------------------------------------------------------
[2004-09-27 04:00:17] nut at phpnut dot com
Description:
------------
Tried using the final keyword on a class variable per the docs
Final Keyword
PHP 5 introduces the final keyword, which prevents child classes from
overriding a method or variable by prefixing the definition with final.
On windows system running 5.0.2 also on Linux running 5.0.1
<?php
class Foo
{
final $FooVersion;
}
?>
Returns:
Cannot declare property Foo::$FooVersion final, the final modifier is
allowed only for methods
Is this a bug or are the docs wrong?
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30250&edit=1