ZF-3917: Zend_Form_Element::isValid() losing error messages with arrays
If you create an element that represents an array and configure a validator, then isValid() will run the validators on each of the values.
Problem 1: array_merge() is used to concatenate messages and errors If two values have the same error (but a different message), then entries in $messages will be overwritten, since the key (error) is the same.
Problem 2: Information about which of the values caused which message/error is lost, so it's impossible to render the error message next to the individual values.
Suggestion: Keep errors and messages in a separate array for each of the values, e.g.: array(  => array( [errors] => same as now, [messages] => same as now, ),  => array( [errors] => same as now, [messages] => same as now, ), )
Then to maintain backwards compatibility and simplicity merge them on the call to getMessages()/getErrors(). Additionaly add methods like getMessagesForValue($index)/getErrorsForValue($index).