From: iblue at gmx dot net
Operating system: Linux 2.6
PHP version: 5.0.3
PHP Bug Type: Scripting Engine problem
Bug description: Problem with int/string array indexing/converting
Description:
------------
php -v gives:
PHP 5.0.3 (cli) (built: Dec 19 2004 15:05:29)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.3, Copyright (c) 1998-2004 Zend Technologies
with Turck MMCache v2.4.6, Copyright (c) 2002-2003 TurckSoft, St.
Petersburg, by Dmitry Stogov
with Zend Extension Manager v1.0.7, Copyright (c) 2003-2004, by Zend
Technologies
with Zend Debugger v3.5.2, Copyright (c) 1999-2004, by Zend
Technologies
Configure line:
'./configure' '--prefix=/usr' '--sysconfdir=/etc' '--with-gmp'
'--with-mysql' '--with-bz2' '--with-gd' '--with-zlib'
'--with-zlib-dir=/usr' '--with-apxs2=/usr/sbin/apxs'
/usr/sbin/httpd -v
Server version: Apache/2.0.49
Server built: Jul 28 2004 17:29:16
The bug only occures, when you open the file with a browser on the server
(apache). When you start the file with php -q or debug it with Zend
Studio, the bug does not occur.
Reproduce code:
---------------
<?php
$x = array("1" => "5", "2" => "7", "3" => "9");
$y = array("2" => "1");
$i=2;
$x[$i] -= $y[$i];
print_r($x);
?>
Expected result:
----------------
Array
(
[1] => 5
[2] => 6
[3] => 9
)
Actual result:
--------------
6
--
Edit bug report at http://bugs.php.net/?id=31916&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=31916&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=31916&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=31916&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=31916&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=31916&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=31916&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=31916&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=31916&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=31916&r=support
Expected behavior: http://bugs.php.net/fix.php?id=31916&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=31916&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=31916&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=31916&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=31916&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=31916&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=31916&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=31916&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=31916&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=31916&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=31916&r=mysqlcfg