diff --git a/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php b/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php index 2b3587c0343ba..a410861df20d4 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php @@ -146,11 +146,10 @@ public function buildForm(FormBuilderInterface $builder, array $options) } } } else { - foreach ($data as $value) { - if ($choiceList->getChoicesForValues([$value])) { - $knownValues[] = $value; - unset($unknownValues[$value]); - } + foreach (array_keys($choiceList->getChoicesForValues($data)) as $index) { + $value = $data[$index]; + $knownValues[] = $value; + unset($unknownValues[$value]); } }