|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78236 convert error on receiving variables when duplicate [
Submitted: 2019-07-01 07:45 UTC Modified: 2020-07-23 09:16 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: hongweichen8888 at sina dot com Assigned: cmb (profile)
Status: Closed Package: Variables related
PHP Version: 7.2.19 OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: hongweichen8888 at sina dot com
New email:
PHP Version: OS:


 [2019-07-01 07:45 UTC] hongweichen8888 at sina dot com
when php receivie the data from external sources, a variables named 'id[[name' will be saved into $_REQUEST['id_[name'];


Will '[' only be replaced once?

Test script:
<form method="post">
    <input type="text" name="id[name" value="1">
    <input type="text" name="id[[name" value="a">
    <input type="submit">

Expected result:
array ( 
  'id_name' => '1', 
  'id__name' => 'a',

Actual result:
array ( 
  'id_name' => '1', 
  'id_[name' => 'a',


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-07-23 09:16 UTC]
-Status: Open +Status: Verified -Type: Documentation Problem +Type: Bug -Package: Documentation problem +Package: Variables related -Assigned To: +Assigned To: cmb
 [2020-07-23 09:16 UTC]
This behavior is unintentional.  According to a comment[1] in the
sources, all open brackets are supposed to be replaced, and
according to the PHP manual[2], dots and spaces in variable names
are converted to underscores.

I have some doubts that we should fix that in the stable branches
for BC reasons, though.

[1] <>
[2] <>
 [2020-07-23 13:48 UTC]
Automatic comment on behalf of
Log: Fix #78236: convert error on receiving variables when duplicate [
 [2020-07-23 13:48 UTC]
-Status: Verified +Status: Closed
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Jun 04 21:03:39 2023 UTC