array_diff weirdness

Posted on 16th Feb 2014 by admin

I'm using the following bit of code

$diff = array_diff($pids, $pidlist);
$diff = array_values($diff); //reindex array to remove empties
//output to $discrepancy
print_r($diff);
exit;

Both $pids and $pidlist contain exactly the same value; so I would have expected that value not to appear in $diff - but it is. Both $pids and $pidlist contain a few thousand values, and I've only found this one example which appears in both lists as well as $diff.

Can anybody shed any light?

Other forums