<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Tue, 18 Jun 2013 23:43:55 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Etienne Kneuss' Blog: SplObjectStorage for a fast and secure object dictionary]]></title>
      <guid>http://www.phpdeveloper.org/news/11700</guid>
      <link>http://www.phpdeveloper.org/news/11700</link>
      <description><![CDATA[<p>
<i>Etienne Kneuss</i> has <a href="http://www.colder.ch/news/01-08-2009/34/splobjectstorage-for-a-fa.html">posted a look</a> at using the SplObjectStorage functionality of the Standard PHP Library as a safe place to tuck away and protect your objects.
</p>
<blockquote>
In PHP, you basically need two things to safely identify an object: a object index, the handle, and the class handlers which is how the object will react internally. This set of handlers is actually a pointer, and since disclosing valid pointers is not something that should be done, spl_object_hash is simply providing a MD5 hash of those two values concatenated.
</blockquote>
<p>
Since arrays are hashed when they are created as well, your script is doubling the amount of work it has to do behind the scenes. Instead, <i>Etienne</i> suggests that you use a SplObjectStorage object instead of an array to keep objects inside. The unique identifier for it is then used directly (instead of rehashed, leaving it open for possible referencing collisions) to reference the object.
</p>]]></description>
      <pubDate>Thu, 08 Jan 2009 10:28:39 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Havard Eide's Blog:  SplObjectStorage]]></title>
      <guid>http://www.phpdeveloper.org/news/10662</guid>
      <link>http://www.phpdeveloper.org/news/10662</link>
      <description><![CDATA[<p>
<i>Havard Eide</i> has a <a href="http://eide.org/2008/07/21/splobjectstorage/">recent post</a> to his blog that looks at a part of the Standard PHP Library (SPL) that can be used with objects to store them for later use - SplObjectStorage.
</p>
<blockquote>
In this post I will look at SplObjectStorage: a container that allows to store objects uniquely without the need to compare them one by one.
</blockquote>
<p>
He lets the code to most of the talking, showing how to do the standard operations for a data store - adding objects (both unique and the same), updating objects in the store, checking to see if an object is already added and removing an object from storage.
</p>]]></description>
      <pubDate>Wed, 23 Jul 2008 08:47:44 -0500</pubDate>
    </item>
  </channel>
</rss>
