note 92499 added to language.oop5.static

From: Date: Mon, 27 Jul 2009 16:26:21 +0000
Subject: note 92499 added to language.oop5.static
Groups: php.notes 
Request: Send a blank email to php-notes+get-158782@lists.php.net to get a copy of this message
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. ---- Server IP: 64.71.164.2 Probable Submitter: 79.103.249.239 ---- Manual Page -- http://www.php.net/manual/en/language.oop5.static.php Edit -- https://master.php.net/note/edit/92499 Del: integrated -- https://master.php.net/note/delete/92499/integrated Del: useless -- https://master.php.net/note/delete/92499/useless Del: bad code -- https://master.php.net/note/delete/92499/bad+code Del: spam -- https://master.php.net/note/delete/92499/spam Del: non-english -- https://master.php.net/note/delete/92499/non-english Del: in docs -- https://master.php.net/note/delete/92499/in+docs Del: other reasons-- https://master.php.net/note/delete/92499 Reject -- https://master.php.net/note/reject/92499 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#158782) next »