Delete duplicate lines in file

More like a warm-up question, I want to know who can win my variation:

file_put_contents('2',array_unique(file('1')));

Accordingly, we read from 1 and write to 2
Who will win by the amount of code?


Answer 1, authority 100%

I don’t know about the amount of code, but in terms of speed, perhaps this option is faster:

file_put_contents('2',array_flip(array_flip(file('1'))));

Answer 2, authority 40%

exec('sort 1 | uniq > 2');