diff --git a/src/Symfony/Component/Form/Extension/Core/ChoiceList/ObjectChoiceList.php b/src/Symfony/Component/Form/Extension/Core/ChoiceList/ObjectChoiceList.php index 7c7aa0c768..0f1437db21 100644 --- a/src/Symfony/Component/Form/Extension/Core/ChoiceList/ObjectChoiceList.php +++ b/src/Symfony/Component/Form/Extension/Core/ChoiceList/ObjectChoiceList.php @@ -128,11 +128,13 @@ class ObjectChoiceList extends ChoiceList if (null === $group) { $groupedChoices[$i] = $choice; } else { - if (!isset($groupedChoices[$group])) { - $groupedChoices[$group] = array(); + $groupName = (string) $group; + + if (!isset($groupedChoices[$groupName])) { + $groupedChoices[$groupName] = array(); } - $groupedChoices[$group][$i] = $choice; + $groupedChoices[$groupName][$i] = $choice; } }