note 92499 deleted from language.oop5.static by thiago
| From: | thiago@php.net | Date: | Wed, 29 Jul 2009 13:07:05 +0000 |
| Subject: | note 92499 deleted from language.oop5.static by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-158870@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
Unfortunately you cannot declare a static const member variable
For example:
class foo{
public static const $CONSTANT=1;
}
echo foo::$CONSTANT;
will give a parse error:
PHP Parse error: syntax error, unexpected T_CONST, expecting T_VARIABLE
static const expressions are very useful, especially since PHP is lacking an enumeration type.