note 84421 added to language.oop5.static
| From: | michaelnospamdotnospamdalyatkayakwiki at osu1 dot php dot net | Date: | Mon, 14 Jul 2008 01:59:45 +0000 |
| Subject: | note 84421 added to language.oop5.static | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-141459@lists.php.net to get a copy of this message | ||
Further to the comment by "erikzoltan NOSPAM at msn NOSPAM dot com" on 05-Apr-2005 03:40,
It isn't just constructors that can't be used for static variable initialization,
it's functions in general:
class XYZ
{
static $foo = chr(1); // will fail
}
You have to do external initialization:
XYZ::$foo = chr(1);
class XYZ
{
static $foo;
}
----
Server IP: 69.147.83.197
Probable Submitter: 206.248.136.96
----
Manual Page -- http://www.php.net/manual/en/language.oop5.static.php
Edit -- https://master.php.net/note/edit/84421
Del: integrated -- https://master.php.net/note/delete/84421/integrated
Del: useless -- https://master.php.net/note/delete/84421/useless
Del: bad code -- https://master.php.net/note/delete/84421/bad+code
Del: spam -- https://master.php.net/note/delete/84421/spam
Del: non-english -- https://master.php.net/note/delete/84421/non-english
Del: in docs -- https://master.php.net/note/delete/84421/in+docs
Del: other reasons-- https://master.php.net/note/delete/84421
Reject -- https://master.php.net/note/reject/84421
Search -- https://master.php.net/manage/user-notes.php