I was doing some investigating on PHP.net and read that array_flip(array_flip()) was faster than array_unique() for integers.

So I did a test, and found it to be so.

I happened to have a list of 750,000 URLs (strings!) in an array, of which many were duplicates (50,000 unique).

I threw it in a test and got some interesting results:

PHP Code:
    $start1 microtime_float();
    
array_unique($list);
    
$stop1=microtime_float();
    echo (
$stop1-$start1)."\n\n";

    
$start2=microtime_float();
    
array_flip(array_flip($list));
    
$stop2=microtime_float();
    echo (
$stop2-$start2)."\n\n"
Code:
3.26775598526
0.36884903907776
When saving the results to files, they were identical.
I know the difference isn't amazing what happens if there is (int)1 and "1" as variables in the array and what happens (too lazy to test today) and probably a number of other things but I found it interesting.

Also it only works if the contents are strings and integers. (PHP very clearly shouts that at you)
Warning: array_flip(): Can only flip STRING and INTEGER values!

Fun fact of the day!