From: z_rules55 at hotmail dot com
Operating system: WinXP
PHP version: 5.1.6
PHP Bug Type: Class/Object related
Bug description: Cannot declare a static array with an index

I would have thought that I could declare a static array in a class with
an index in the declaration, but I can't. I must instead use array() to
specify the desired index and value. Nowhere in the docs, that I could
find, does it say that you can't specify an index in a static array

I saw in another bug that PHP does not allow the use of variable data at
compile time, and I guess since static variables are dealt with at compile
time, you can't be assigning data to a variable index. But even if the
index is define()ed beforehand, it still doesn't work.

Reproduce code:
define('INDEX', 'index');
class myclass {
// Does not with either the string 'index' or
// the constant INDEX.
public static $variable['index'] = 'some value';
//public static $variable = array('index' => 'some value'); This does
echo myclass::$variable['index'];

Expected result:
some value

Actual result:
P error: p error, unexpected '[', expecting ',' or ';' in ... on
line 6

Edit bug report at [url][/url]
Try a CVS snapshot (PHP 4.4): [url][/url]
Try a CVS snapshot (PHP 5.2): [url][/url]
Try a CVS snapshot (PHP 6.0): [url][/url]
Fixed in CVS: [url][/url]
Fixed in release: [url][/url]
Need backtrace: [url][/url]
Need Reproduce Script: [url][/url]
Try newer version: [url][/url]
Not developer issue: [url][/url]
Expected behavior: [url][/url]
Not enough info: [url][/url]
Submitted twice: [url][/url]
register_globals: [url][/url]
PHP 3 support discontinued: [url][/url]
Daylight Savings: [url][/url]
IIS Stability: [url][/url]
Install GNU Sed: [url][/url]
Floating point limitations: [url][/url]
No Zend Extensions: [url][/url]
MySQL Configuration Error: [url][/url]