{"action":"created","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/15343","labels_url":"https://api.github.com/repos/symfony/symfony/issues/15343/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/15343/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/15343/events","html_url":"https://github.com/symfony/symfony/issues/15343","id":96761731,"number":15343,"title":"ChoiceQuestion undefined index","user":{"login":"funivan","id":425208,"avatar_url":"https://avatars.githubusercontent.com/u/425208?v=3","gravatar_id":"","url":"https://api.github.com/users/funivan","html_url":"https://github.com/funivan","followers_url":"https://api.github.com/users/funivan/followers","following_url":"https://api.github.com/users/funivan/following{/other_user}","gists_url":"https://api.github.com/users/funivan/gists{/gist_id}","starred_url":"https://api.github.com/users/funivan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/funivan/subscriptions","organizations_url":"https://api.github.com/users/funivan/orgs","repos_url":"https://api.github.com/users/funivan/repos","events_url":"https://api.github.com/users/funivan/events{/privacy}","received_events_url":"https://api.github.com/users/funivan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/symfony/symfony/labels/Console","name":"Console","color":"DDDDDD"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-07-23T08:34:24Z","updated_at":"2015-07-29T12:47:31Z","closed_at":"2015-07-23T22:08:24Z","body":"Try to use ChoiceQuestion. Failure in any case\r\nState:\r\n```\r\n> php --version\r\n> PHP 5.5.9-1ubuntu4.11 (cli) (built: Jul  2 2015 15:23:08) \r\n```\r\nHow to reproduce: \r\ncreate directory \r\n`mkdir /tmp/cons && cd  /tmp/cons`\r\ninstall console component\r\n`composer require \"symfony/console:^2.7\"\r\n`\r\ncreate `test.php` \r\n```php\r\n<?php\r\n  require_once 'vendor/autoload.php';\r\n\r\n  use Symfony\\Component\\Console\\Application;\r\n  use Symfony\\Component\\Console\\Command\\Command;\r\n  use Symfony\\Component\\Console\\Input\\InputInterface;\r\n  use Symfony\\Component\\Console\\Output\\OutputInterface;\r\n  use Symfony\\Component\\Console\\Question\\ChoiceQuestion;\r\n\r\n  class ColorCommand extends Command {\r\n\r\n    protected function configure() {\r\n      $this->setName('color');\r\n\r\n    }\r\n\r\n    protected function execute(InputInterface $input, OutputInterface $output) {\r\n      $helper = $this->getHelper('question');\r\n      $question = new ChoiceQuestion(\r\n        'Please select your favorite color (defaults to red)',\r\n        array('red', 'blue', 'yellow')\r\n      );\r\n      $question->setMultiselect(true);\r\n      $question->setErrorMessage('Color %s is invalid.');\r\n\r\n      $color = $helper->ask($input, $output, $question);\r\n      $output->writeln('You have just selected: ' . $color);\r\n\r\n    }\r\n  }\r\n\r\n\r\n  $application = new Application();\r\n  $application->add(new ColorCommand());\r\n  $application->run();\r\n```\r\n\r\nRun `php test.php color`\r\nSelect any color.\r\n\r\nMy result:\r\n`\r\nNotice: Undefined index: yellow in /tmp/cons/vendor/symfony/console/Question/ChoiceQuestion.php on line 165\r\n`\r\nMore backtrace:\r\nhttp://i.imgur.com/8hsLIwe.png\r\nhttp://i.imgur.com/UDyRsS4.png\r\n"},"comment":{"url":"https://api.github.com/repos/symfony/symfony/issues/comments/125939475","html_url":"https://github.com/symfony/symfony/issues/15343#issuecomment-125939475","issue_url":"https://api.github.com/repos/symfony/symfony/issues/15343","id":125939475,"user":{"login":"psynaptic","id":10507,"avatar_url":"https://avatars.githubusercontent.com/u/10507?v=3","gravatar_id":"","url":"https://api.github.com/users/psynaptic","html_url":"https://github.com/psynaptic","followers_url":"https://api.github.com/users/psynaptic/followers","following_url":"https://api.github.com/users/psynaptic/following{/other_user}","gists_url":"https://api.github.com/users/psynaptic/gists{/gist_id}","starred_url":"https://api.github.com/users/psynaptic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psynaptic/subscriptions","organizations_url":"https://api.github.com/users/psynaptic/orgs","repos_url":"https://api.github.com/users/psynaptic/repos","events_url":"https://api.github.com/users/psynaptic/events{/privacy}","received_events_url":"https://api.github.com/users/psynaptic/received_events","type":"User","site_admin":false},"created_at":"2015-07-29T12:47:31Z","updated_at":"2015-07-29T12:47:31Z","body":"I updated to 2.7.x-dev and the problem of using numeric keys is resolved for me.\r\n\r\n```\r\n$ php test.php color\r\nPlease select the site to build:\r\n  [0] red\r\n  [1] blue\r\n  [2] yellow\r\n > 1\r\nYou have just selected: blue\r\n```"}}