Incorrect/invalid select tag is generated if choices have duplicate content ('Category 4').
$f = $this->formFactory->createNamedBuilder('category', 'form')
->add('parent_category', 'choice', array(
'label' => 'Name',
'choices' => array(
'1' => 'Category 1',
'2' => 'Category 4',
'3' => 'Category 3',
'4' => 'Category 4',
'5' => 'Category 5'
)
))
->add('save', 'submit', array(
'label' => 'Save'
))
->getForm();
<select>
<option value="1" >Category 1</option>
<option value="4" >Category 4</option>
<option value="3" >Category 3</option>
<option value="5" >Category 5</option>
</select>