this should work best as far as I know and tried..I used the serialize because oddly it couldnt compare strings

hope it maybe help someone there that needs it

$new=array();

$exclude = array("");

foreach ($myItems as $item)
{
if (!in_array(serialize($item->fileName) ,$exclude))
{
$new[] = $item;
array_push($exclude, serialize($item->fileName));
}
}