|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24565 cannot read array elements recived via $_REQUEST
Submitted: 2003-07-09 11:16 UTC Modified: 2003-07-22 11:11 UTC
Avg. Score:4.3 ± 0.5
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:1 (33.3%)
From: nightcat at poczta dot onet dot pl Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5.0.0b2-dev OS: *
Private report: No CVE-ID: None
 [2003-07-09 11:16 UTC] nightcat at poczta dot onet dot pl
In PHP5 yesterdays snapshot i'm unable to get array element created by POST/GET method.

Reproduce code:
if (isset($_REQUEST['arr1'])) {
  print_r($_REQUEST['arr1']); // displays key and value.
  print('test1: '.$_REQUEST['arr1'][0]); // error
  print_r(array_keys($_REQUEST['arr1'])); // returns one index: '0'
<title> TestCase </title>
<form method=post action="">
test1: <input type="checkbox" name="arr1[0]" value="1" /><br />
<input type="submit" />

Expected result:
test1: 1

Actual result:
Notice: Undefined offset: 2 in D:\server\www\test\php5\index.phtml on line 4


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-09 15:05 UTC] tingle at virtuanews dot co dot uk
Confirmed using Apache 2.0.46, Windows XP SP1 and the latest snapshot (

Identical problem as stated

print_r() gives the expected output with the expected keys and values, however, trying to reference the key within the code results in it not being set
 [2003-07-09 16:00 UTC]
Reproduced with latest PHP 5 CVS. Works fine with PHP 4.3.3RC2-dev.

 [2003-07-21 22:29 UTC] vma1 at abv dot bg
One more thing - setting "register_long_arrays = On" in php.ini makes the problem go away. But its bad because of the performance hit.
 [2003-07-22 05:14 UTC] Nico dot Laus dot 2001 at gmx dot de
look at
-> same Bug

btw: I have set "register_long_arrays = On" and it does not chang anything - same problems as before!
 [2003-07-22 10:01 UTC] vma1 at abv dot bg
> btw: I have set "register_long_arrays = On" and it does
> not chang anything - same problems as before!
Yes it was my mistake. Actually this problem stays even after long arrays are enabled
 [2003-07-22 11:11 UTC]
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at
In case this was a documentation problem, the fix will show up soon at

In case this was a website problem, the change will show
up on the site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed May 27 05:01:27 2020 UTC