`\UnexpectedValueException` is throw in the `value` of the `$keyIndex` named field is invalid for an array index.
Example:
```php
$input = [['key' => array(), 'value' => 123];

$result = Arrays::extract($input, 'key', 'value');
```
The above code would try to create an array like this
```
array(
array() => '123'
);
```
Array keys must be scalar.

The last `\Exception` case handles this case
```php
$input = [
    ['key' => 'foo', 'value' => 'bar'],
    ['key' => 'foo', 'value' => 'baz'],
];

$result = Arrays::extract($input, 'key', 'value', 'throw');
```
In this case, `foo` is duplicated and exception must be thrown since the user passed in `throw` as the duplicate behavior