php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #65659 Wrong description of max_input_vars config var
Submitted: 2013-09-12 13:39 UTC Modified: 2013-09-12 14:37 UTC
From: gabri dot ns at gmail dot com Assigned: levim (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
 [2013-09-12 13:39 UTC] gabri dot ns at gmail dot com
Description:
------------
From http://www.php.net/manual/en/info.configuration.php#ini.max-input-vars
it stated that the limitation is only on each nested level of multidimensional 
array. But actually, it limit on the root level of variabel. Easy speaking, it 
count appearance of '&' in input.

this script should work since each level only contain 900 var, but it stopped 
after 1000th appearance of '&'

it may be connected to Bug #60728

Test script:
---------------
$a = array();
for ($i = 0; $i < 900; $i++)
{
  if ($i != 899) $a['asd'.$i] = "$i";
  else for ($j = 0; $j < 900; $j++)
    $a['asd'.$i]['qwe'.$j] = "$i - $j";
}
$a = http_build_query($a);
parse_str($a,$b);
$b = http_build_query($b);
echo count(explode('&',$a))."\n";
echo count(explode('&',$b))."\n";

Expected result:
----------------
1799
1799

Actual result:
--------------
Warning: parse_str(): Input variables exceeded 1000. To increase the limit change 
max_input_vars in php.ini. in var://_POST/script on line 9
1799
1000

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-09-12 14:08 UTC] leight+bugs dot php at gmail dot com
Looking at main/php_variables.c it appears that no attempt is made to discern 
between nesting levels.

I wondered if this was a documentation issue, or a bug with the code not checking 
nesting. It looks to be the documentation at fault.
 [2013-09-12 14:32 UTC] leight+bugs dot php at gmail dot com
This is a duplicate of https://bugs.php.net/bug.php?id=62921

The documentation is fixed in the SVN, but is not live yet.
 [2013-09-12 14:37 UTC] levim@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: levim
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 04:00:01 2026 UTC