From: [EMAIL PROTECTED]
Operating system: Linux 2.6.26-gentoo
PHP version: 5.3CVS-2008-08-07 (CVS)
PHP Bug Type: *Compile Issues
Bug description: Wrong class array inpretetion using constant indexes
Description:
------------
If an array is used as a class property and the keys are constants, where
two keys / constants have the same value, the second key is converted to a
"strange" string.
Reproduce code:
---------------
<?php
class Constants {
// Needs to be equal
const A = 1;
const B = 1;
}
class ArrayProperty {
public static $array = array(
Constants::A => 23,
Constants::B => 42,
);
}
var_dump( ArrayProperty::$array );
?>
Expected result:
----------------
Output PHP 5.2.7-dev (cli) (built: Aug 7 2008 11:12:42) (DEBUG)
array(1) {
[1]=>
int(42)
}
Actual result:
--------------
Output PHP 5.3.0alpha2-dev (cli) (built: Aug 6 2008 19:47:42) (DEBUG)
array(2) {
[1]=>
int(23)
["Constants::"]=>
int(42)
}
--
Edit bug report at http://bugs.php.net/?id=45742&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=45742&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=45742&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=45742&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=45742&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=45742&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=45742&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=45742&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=45742&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=45742&r=support
Expected behavior: http://bugs.php.net/fix.php?id=45742&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=45742&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=45742&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=45742&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45742&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=45742&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=45742&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=45742&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=45742&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=45742&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=45742&r=mysqlcfg