$form['myselect'] = array(
'#title' => 'My Select',
'#key_type' => 'associative',
'#type' => 'select',
'#options' => array(
'NORMALKEY' => 'Normal Key',
'307' => '307', // numeric key...
'OTHERKEY' => 'Other Key',
'20' => '20', // another numeric key..
),
);
produces a form-select like:
<select id="edit-myselect" class="form-select" name="myselect">
<option value="NORMALKEY">Normal Key</option>
<option value="0">307</option>
<option value="OTHERKEY">Other Key</option>
<option value="1">20</option>
</select>
instead of:
<select id="edit-myselect" class="form-select" name="myselect">
<option value="NORMALKEY">Normal Key</option>
<option value="307">307</option>
<option value="OTHERKEY">Other Key</option>
<option value="20">20</option>
</select>