php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62921 max_input_vars crops total amount of variables, not per nesting level
Submitted: 2012-08-24 10:06 UTC Modified: 2013-09-12 14:37 UTC
Votes:10
Avg. Score:4.5 ± 0.8
Reproduced:9 of 9 (100.0%)
Same Version:1 (11.1%)
Same OS:0 (0.0%)
From: andysh at ukr dot net Assigned: daverandom (profile)
Status: Closed Package: Documentation problem
PHP Version: 5.4.6 OS: FreeBSD 9.0-RELEASE
Private report: No CVE-ID: None
 [2012-08-24 10:06 UTC] andysh at ukr dot net
Description:
------------
I set in php.ini
  max_input_vars = 10000

Than I post array which has 100 elements on first level and 105 elements on second level for every first-level element.

I expected to receive full array, but it was cropped to 10000 elements. 

Documentation says: "This limit applies only to each nesting level of a multi-dimensional input array." (http://www.php.net/manual/en/info.configuration.php#ini.max-input-vars).

Test script:
---------------
<?
if (!empty($_POST)) {
	echo '<pre>';
	var_dump($_POST);
	die;
}
?>

<form action='' method='POST'>
	<? for ($i = 0; $i < 100; $i++): ?>
		<? for ($j = 0; $j < 105; $j++): ?>
			<input type='text' name='ch[<?= $i ?>][]' value='<?= $j ?>' />
		<? endfor; ?>
	<? endfor; ?>
	<input type='submit' />
</form>


Expected result:
----------------
Array which has:
 - 1 element on zero level
 - 100 elements on first level
 - 105 elements on second level for every first-level element

Actual result:
--------------
Array has:
 - 1 element on zero level
 - 96 elements on first level
 - 105 elements on second level for first 95 first-level elements
 - 25 elements on second level for last first-level element
Total amount of elements in array is 10000

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-08-24 14:03 UTC] rasmus@php.net
This is a documentation bug. The limit is across all nesting levels.
 [2012-08-24 14:03 UTC] rasmus@php.net
-Package: PHP options/info functions +Package: Documentation problem
 [2013-09-09 14:34 UTC] daverandom@php.net
Automatic comment from SVN on behalf of daverandom
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=331320
Log: Per Bug #62921, max_input_vars is not per nesting level.

--
Provided by anonymous #33344 (keithm@aoeex.com)
 [2013-09-12 14:37 UTC] daverandom@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: daverandom
 [2013-09-12 14:37 UTC] daverandom@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 11:01:28 2024 UTC