php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52771 array(key => value) incorrect behaviour when key="join"
Submitted: 2010-09-03 19:09 UTC Modified: 2010-09-03 19:16 UTC
From: mpchanzy at yahoo dot ca Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: Irrelevant OS: windows xp
Private report: No CVE-ID: None
 [2010-09-03 19:09 UTC] mpchanzy at yahoo dot ca
Description:
------------
I didn't find information on this bug online and couldn't update my version.
I have php 5.2.6 (installed with wampserver).

The bug is easy to reproduce so I thought I should just let you know as it may be related to other bugs that interpret the key value instead of reading it as a string in a 2D-array.

$params[] = array ("join" => "a", "join" => "b"); echo($params[0]);echo($params[0]);
returns "b" instead of "a"  
It seems as though when the key="join", previous entries of the array are deleted. 



Test script:
---------------
$params[] = array ("join" => "a", "join" => "b");
echo($params[0]);


Expected result:
----------------
I should be getting "a" 


Actual result:
--------------
I get "b"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-09-03 19:16 UTC] mpchanzy at yahoo dot ca
-Status: Open +Status: Closed
 [2010-09-03 19:16 UTC] mpchanzy at yahoo dot ca
sorry it's not a bug.
For some reason I thought key=>value had to be unique...I've been working too much.
 [2010-09-03 19:16 UTC] rasmus@php.net
-Status: Closed +Status: Bogus
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jun 17 08:01:32 2024 UTC