The problem here is that you're updating the same object, and the object itself is not added twice.
If you're only working with strings, it would be more efficient to use an array:
$array = [];
if (!isset($array['11111'])) {
$array['11111'] = true;
}
// etc.
Afterwards, you can use array_keys()
to fetch all unique values.