{"action":"created","issue":{"url":"https://api.github.com/repos/adamwathan/form/issues/28","labels_url":"https://api.github.com/repos/adamwathan/form/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/adamwathan/form/issues/28/comments","events_url":"https://api.github.com/repos/adamwathan/form/issues/28/events","html_url":"https://github.com/adamwathan/form/pull/28","id":51467547,"number":28,"title":"add test for integer values in options array","user":{"login":"arbetts","id":4163848,"avatar_url":"https://avatars.githubusercontent.com/u/4163848?v=3","gravatar_id":"","url":"https://api.github.com/users/arbetts","html_url":"https://github.com/arbetts","followers_url":"https://api.github.com/users/arbetts/followers","following_url":"https://api.github.com/users/arbetts/following{/other_user}","gists_url":"https://api.github.com/users/arbetts/gists{/gist_id}","starred_url":"https://api.github.com/users/arbetts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arbetts/subscriptions","organizations_url":"https://api.github.com/users/arbetts/orgs","repos_url":"https://api.github.com/users/arbetts/repos","events_url":"https://api.github.com/users/arbetts/events{/privacy}","received_events_url":"https://api.github.com/users/arbetts/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-12-09T19:03:41Z","updated_at":"2015-02-08T17:03:34Z","closed_at":"2015-02-08T17:03:34Z","pull_request":{"url":"https://api.github.com/repos/adamwathan/form/pulls/28","html_url":"https://github.com/adamwathan/form/pull/28","diff_url":"https://github.com/adamwathan/form/pull/28.diff","patch_url":"https://github.com/adamwathan/form/pull/28.patch"},"body":"Hi,\r\n\r\nI was using BootForm::select and I was trying to create integer values for the options. I found that if I started my array with '1' the select worked perfectly, but if i started with '0' then it didn't... i think this is because arrays erase the \"type\" of the key if it equals an integer value\r\n\r\n$array = array();\r\n  $array['1'] = 'value';\r\n  var_dump($array);\r\narray(1) { [1]=> string(5) \"value\" }\r\n\r\nmy options array looked like this\r\nworking ... array('1' => 'Active', '0' => 'Inactive')\r\nbroken ... array('0' => 'Inactive', '1' => 'Active')\r\n\r\nI am unsure of how to fix the issue, but i thought i would send along a pull with a test to show what i found.\r\n\r\nBootForms has been great,\r\nthanks for putting it together!\r\n"},"comment":{"url":"https://api.github.com/repos/adamwathan/form/issues/comments/73419778","html_url":"https://github.com/adamwathan/form/pull/28#issuecomment-73419778","issue_url":"https://api.github.com/repos/adamwathan/form/issues/28","id":73419778,"user":{"login":"adamwathan","id":4323180,"avatar_url":"https://avatars.githubusercontent.com/u/4323180?v=3","gravatar_id":"","url":"https://api.github.com/users/adamwathan","html_url":"https://github.com/adamwathan","followers_url":"https://api.github.com/users/adamwathan/followers","following_url":"https://api.github.com/users/adamwathan/following{/other_user}","gists_url":"https://api.github.com/users/adamwathan/gists{/gist_id}","starred_url":"https://api.github.com/users/adamwathan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamwathan/subscriptions","organizations_url":"https://api.github.com/users/adamwathan/orgs","repos_url":"https://api.github.com/users/adamwathan/repos","events_url":"https://api.github.com/users/adamwathan/events{/privacy}","received_events_url":"https://api.github.com/users/adamwathan/received_events","type":"User","site_admin":false},"created_at":"2015-02-08T17:03:34Z","updated_at":"2015-02-08T17:03:34Z","body":"I actually made some changes related to this months ago, maybe you are on an older version? Or maybe I didn't tag a release after making that change, heh...\r\n\r\nEither way, I've added your test to the test suite here: https://github.com/adamwathan/form/commit/f0349856ca7c407b99f68cb28ee0c4630ad52c2e\r\n\r\n...and it passes because I ended up making similar changes to what you have a few months back. Basically abandoning any of the \"guess the key\" crap I was doing before.\r\n\r\nThanks for the PR either way, good to get this test in anyways."}}