php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31916 Problem with int/string array indexing/converting
Submitted: 2005-02-10 19:43 UTC Modified: 2005-02-11 19:55 UTC
From: iblue at gmx dot net Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5.0.3 OS: Linux 2.6
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: iblue at gmx dot net
New email:
PHP Version: OS:

 

 [2005-02-10 19:43 UTC] iblue at gmx dot net
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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-10 19:47 UTC] tony2001@php.net
Do not file bugs when you have Zend extensions (zend_extension=)
loaded. Examples are Zend Optimizer, Zend Debugger, Turck MM Cache,
APC, Xdebug and ionCube loader.  These extensions often modify engine
behavior which is not related to PHP itself.


 [2005-02-11 19:55 UTC] iblue at gmx dot net
Turck MMCache 2.0.3 is buggy for PHP5.
Sorry
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Sep 19 14:01:28 2024 UTC