title: How to push large set of strings to SplObjectStorage in PHP and if string exist not to push
body: <p>Basically what I need is to push a large set of strings to SplObjectStorage and if each string doesn't exist do some kind of action, if it does exist do other action. </p>
  
  <pre><code>$o1-&gt;id = '11111';
  $s-&gt;attach($o1);
  $o1-&gt;id = '22222';
  $s-&gt;attach($o1);
  </code></pre>
  
  <p>I only get 22222 in the object, or it overwrites the object.
  I need to get both, And if they match just one of them.
  I need to get distinct values of my strings</p>