title: PHP type check for associative array index isn't string, like it should be
body: <p>I'm running into an issue here.</p>
  
  <pre><code>$arr = array ('1' =&gt; 'one');
  var_dump(current(array_keys($arr)));
     // prints: int(1)
     // should print: string(1) "1"
  </code></pre>
  
  <p>I am trying to create an associative array, but PHP is converting my strings into integers on me.</p>
  
  <p>I am generating markup for a series of &lt;input type="radio"&gt; buttons, and applying the checked attribute to the one whose value matches that in the POST request, e.g.</p>
  
  <pre><code>$selected = isset($_POST[$this-&gt;name]) ? $_POST[$this-&gt;name] : null;
  foreach ($this-&gt;options as $value =&gt; $label) {
     $html .= "&lt;input type=\"radio\" name=\"{$this-&gt;name}\" value=\"$value\"".
              ($_POST[$this-&gt;name] === $value ? ' checked' : '').'&gt;';
  }
  </code></pre>
  
  <p>I could just use two equal signs and not type-compare; however, if the array is:</p>
  
  <pre><code>$this-&gt;options = array (
     '0' =&gt; 'No',
     '1' =&gt; 'Yes'
  );
  </code></pre>
  
  <p>it would select the 0 option, even if the the POST value isn't set. However, it shouldn't select ANY radio button, because none of them have the value of null.</p>
  
  <p><strong>EDIT:</strong> Just found this: "Strings containing valid integers will be cast to the integer type. E.g. the key "8" will actually be stored under 8. On the other hand "08" will not be cast, as it isn't a valid decimal integer." in the PHP Manual. Think there'd be anyway to circumvent that?</p>