<?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, 19 Jun 2013 20:42:34 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Lukas Smith's Blog: To serialize or to not serialize?]]></title>
      <guid>http://www.phpdeveloper.org/news/5562</guid>
      <link>http://www.phpdeveloper.org/news/5562</link>
      <description><![CDATA[<p>
In <a href="http://pooteeweet.org/blog/413">his latest post</a>, <i>Lukas Smith</i> talks about serializing data - some of the pros and cons about it, as well as his experiences with it in the development of his own framework.
</p>
<quote>
<i>
<p>
In my own framework I have decided that there is plenty of structured data that I will never query on that I will just stick into the database as a serialized array. Now the other day I modified the auto type handling in MDB2's <a href="http://pear.php.net/package/MDB2/docs/latest/MDB2/MDB2_Driver_Common.html#methodquote">quote()</a> method to automatically serialize array's if no type is explicitly passed to the quote() method.
</p>
<p>
I send out a <a href="http://marc.theaimsgroup.com/?l=pear-dev&m=114841748412490&w=2">question</a> to pear-dev@ and it was not unanimously well received. So I sat down and pondered a more elegant approach. Actually there is already one approach implemented in MDB2 since ages.
</p>
</i>
</quote>
<p>
This implementation uses a seperate module that abuses PHP5's overloading functionality to integrate it easily. He also looked into another solution, however - creating a "datatype map" to help with the custom automatic serialization of datatypes (not just dependant on the variable type like before). Be sure to check out <a href="http://pooteeweet.org/blog/413#comments">the comments</a> for more thoughts on the subject, including validation of the custom datatypes.
</p>]]></description>
      <pubDate>Mon, 12 Jun 2006 06:01:46 -0500</pubDate>
    </item>
  </channel>
</rss>
