From: rele at gmx dot de
Operating system: Windows XP SP1
PHP version: 5.0.0b1 (beta1)
PHP Bug Type: Zend Engine 2 problem
Bug description: Zend Engine 2 doesn't recognize access to indizes of class array
constants
Description:
------------
The new per-class constants, introduced in PHP 5, don't allow to access
array indizes.
If I define an array as a constant of a class and try to access the first
index of this constant for example, the Zend Engine 2 gives a parse
error.
Only index access on a variable, that points to this constant, works.
Reproduce code:
---------------
Class Example {
const CATEGORIES = array('a', 'b');
}
$c=Example::CATEGORIES;
echo $c[0] . "\n";
echo Example::CATEGORIES[1] . "\n";
Expected result:
----------------
a
b
Actual result:
--------------
PHP Parse error: parse error, unexpected '[' in example.php on line 8
--
Edit bug report at http://bugs.php.net/?id=24569&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=24569&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=24569&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=24569&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=24569&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=24569&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=24569&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=24569&r=support
Expected behavior: http://bugs.php.net/fix.php?id=24569&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=24569&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=24569&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=24569&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24569&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=24569&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=24569&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=24569&r=gnused