The max_input_vars setting is defined as "How many input variables may be accepted" but this is not completely correct. There is a +1 factor.
For example, if the value is 2 then the $_POST array can have up to 3 elements, if it is 1000 then it can have 1001 elements, and so on.
I want to stop the execution of the php code when there is a chance that some data was not received. Therefore, instead of relying on the standard E_WARNING, I do this in my code.
<?php
$max_input_vars = ini_get('max_input_vars');
if (count($_POST) === $max_input_vars + 1) { throw new Exception();
}
?>
If the size of the $_POST array reaches the maximum then there is the chance that there was more data so it is better to stay on the safe side and increase the config value.