|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52548 multiple $_POST array values not being assigned correctly
Submitted: 2010-08-06 01:48 UTC Modified: 2010-08-06 02:05 UTC
From: qrstuv+php at gmail dot com Assigned:
Status: Not a bug Package: HTTP related
PHP Version: Irrelevant OS: Ubuntu 10.04
Private report: No CVE-ID: None
 [2010-08-06 01:48 UTC] qrstuv+php at gmail dot com
The value of a $_POST array item is not being assigned properly

Test script:
<form method="post">
<input type="submit" name="step4[edit][change]" value="Submit and continue">
<input type="submit" name="step4[edit]" value="Continue without changes">

//After form submission

Expected result:
//When "Continue without changes" is pressed, expected value:

Actual result:
//When "Continue without changes" is pressed...

//Actual value:
string(1) "C"

//The "C" is taken from the first character of the value of $_POST['step4']

//A var_dump of $_POST['step4']['edit'] returns the value as expected as does a 
var_dump of $_POST['step4']['edit']['change'] when that is actually pressed.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-08-06 02:05 UTC]
-Status: Open +Status: Bogus
 [2010-08-06 02:05 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

In your example $_POST['step4']['edit'] will be set to "Continue without changes", the offset ['change'] will be used as string index, 'change' is being casted to an integer value, 0, so the first character is returned.
 [2010-08-06 02:11 UTC] qrstuv+php at gmail dot com
Ah, I understand. Thank you for your prompt response. Sorry for the bogus report.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Mar 26 12:08:19 2023 UTC