From: xuefer at 21cn dot com
Operating system: winxp
PHP version: 5CVS-2004-01-11 (dev)
PHP Bug Type: Zend Engine 2 problem
Bug description: (string) numeric constant as the key of static array mess up!
Description:
------------
defined numeric constant but in string type
used in static $a = array(A => 1);
this produce array $a with a messed up key
Reproduce code:
---------------
under cygwin:
./php5/php.exe -n -r 'define("A", "1"); static $a=array(A => 1);
var_dump($a); echo isset($a[A]); echo "\n";'
Expected result:
----------------
array(1) {
[1]=>
int(1)
}
1
Actual result:
--------------
array(1) {
["1"]=>
int(1)
}
--
Edit bug report at http://bugs.php.net/?id=26869&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=26869&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=26869&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=26869&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=26869&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=26869&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=26869&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=26869&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=26869&r=support
Expected behavior: http://bugs.php.net/fix.php?id=26869&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=26869&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=26869&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=26869&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26869&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=26869&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=26869&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=26869&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26869&r=float