Fix generating array with unsorted keys

For example array

```php
$value = array(
    1 => 'a',
    0 => 'b',
    'c'
)
```

generating to 

```php
array(
    1 => 'a',
    'b', // this value will be lost, because it will be rewrite by value 'c'
    2 => 'c'
)
```

this patch fix it, and do as expected

```php
array(
    1 => 'a',
    0 => 'b',
    'c'
)