array_flip will remove duplicate values in the original array when you flip either an associative or numeric array. As you might expect it's the earlier of two duplicates that is lost:
<?php
$a = array('one', 'two', 'one');
print_r($a);
$b = array_flip($a);
print_r($b);
?>
Result:
array(3) {
[0] => string(3) "one"
[1] => string(3) "two"
[2] => string(3) "one"
}
array(2) {
'one' => int(2)
'two' => int(1)
}
This may be good or bad, depending on what you want, but no error is thrown.