<?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>Wed, 22 May 2013 06:14:42 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Evert Pot's Blog: PHP: Arrays vs. Objects]]></title>
      <guid>http://www.phpdeveloper.org/news/8479</guid>
      <link>http://www.phpdeveloper.org/news/8479</link>
      <description><![CDATA[<p>
Wanting to test out a new way of doing things, <i>Evert Pot</i> decided to <a href="http://www.rooftopsolutions.nl/article/148">write up some tests</a> using a <a href="http://en.wikipedia.org/wiki/Value_Objects">Value Object</a> style of data storage versus just in arrays:
</p>
<blockquote>
In a lot of cases arrays are used in PHP to store object-like information, like the results of a database query. I do this a lot too, but I kind of want to change things around to make use of <a href="http://en.wikipedia.org/wiki/Value_Objects">VO's</a>. I feel this makes a lot more sense, since most of the application I build are heavy OOP anyway, and I get all the added OOP benefits, like type-hinting, inheritance.. well, you know the deal.
</blockquote>
<p>
In <a href="http://www.rooftopsolutions.nl/article/148">his tests</a> he creates an array of data, a value block of three "properties", looped 1000 times) and  a block of three actual properties on an object. Between each, he's using the XDebug memory usage functions to check to see which uses less resources.
</p>
<p>
Overall, there's really not that much of a difference between using either of them. So, basically, it's up to you which storage method is the simplest for you to use.
</p>]]></description>
      <pubDate>Fri, 17 Aug 2007 10:27:00 -0500</pubDate>
    </item>
  </channel>
</rss>
