Bug #53838 [NEW]: Double Indexes in arrays / objects after cast
| From: | bobwei9 at hotmail dot com | Date: | Tue, 25 Jan 2011 19:31:18 +0000 |
| Subject: | Bug #53838 [NEW]: Double Indexes in arrays / objects after cast | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-158173@lists.php.net to get a copy of this message | ||
From:
Operating system: Mac OS X 10.6
PHP version: 5.3.5
Package: Class/Object related
Bug Type: Bug
Bug description:Double Indexes in arrays / objects after cast
Description:
------------
You can see here that once it's a string-index and once an int-index. But I
don't suppose that this result is wanted?
p.ex.:
http://bobweinand.no-ip.org/php_test.php?simu%5Bang%5D%5B1%5D=79&simu%5Bver%5D%5B1%5D=&simu%5Bang%5D%5B2%5D=786&simu%5Bver%5D%5B2%5D=&simu%5Bang%5D%5B3%5D=&simu%5Bver%5D%5B3%5D=78786&simu%5Bang%5D%5B4%5D=&simu%5Bver%5D%5B4%5D=8&simu%5Bang%5D%5B5%5D=89&simu%5Bver%5D%5B5%5D=8&simu%5Bang%5D%5B6%5D=&simu%5Bver%5D%5B6%5D=445&simu%5Bang%5D%5B7%5D=&simu%5Bver%5D%5B7%5D=3&simu%5Bang%5D%5B8%5D=&simu%5Bver%5D%5B8%5D=
Test script:
---------------
http://bobweinand.no-ip.org/php_bug_test.php
Expected result:
----------------
string(1) "1"
string(1) "2"
string(1) "3"
string(1) "4"
string(1) "5"
string(1) "6"
string(1) "7"
string(1) "8"
Array
(
[0] => stdClass Object
(
[1] => 0
[2] => 0
[3] => 0
[4] => 0
[5] => 0
[6] => 0
[7] => 0
[8] => 0
)
[1] => stdClass Object
(
[1] =>
[2] =>
[3] => 78786
[4] => 8
[5] => 8
[6] => 445
[7] => 3
[8] =>
)
)
Actual result:
--------------
int(1)
int(2)
int(3)
int(4)
int(5)
int(6)
int(7)
int(8)
string(1) "1"
string(1) "2"
string(1) "3"
string(1) "4"
string(1) "5"
string(1) "6"
string(1) "7"
string(1) "8"
Array
(
[0] => stdClass Object
(
[1] => 79
[2] => 786
[3] =>
[4] =>
[5] => 89
[6] =>
[7] =>
[8] =>
[1] => 0
[2] => 0
[3] => 0
[4] => 0
[5] => 0
[6] => 0
[7] => 0
[8] => 0
)
[1] => stdClass Object
(
[1] =>
[2] =>
[3] => 78786
[4] => 8
[5] => 8
[6] => 445
[7] => 3
[8] =>
[1] => 0
[2] => 0
[3] => 0
[4] => 0
[5] => 0
[6] => 0
[7] => 0
[8] => 0
)
)
--
Edit bug report at http://bugs.php.net/bug.php?id=53838&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=53838&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=53838&r=trysnapshot53
Try a snapshot (trunk): http://bugs.php.net/fix.php?id=53838&r=trysnapshottrunk
Fixed in SVN: http://bugs.php.net/fix.php?id=53838&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53838&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=53838&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=53838&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=53838&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=53838&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=53838&r=support
Expected behavior: http://bugs.php.net/fix.php?id=53838&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=53838&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=53838&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=53838&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53838&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=53838&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=53838&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=53838&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=53838&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=53838&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=53838&r=mysqlcfg