<?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, 08 Jul 2008 23:26:22 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Cal Evans' Blog: I called Zend_Json::encode(), so WTH are all my properties?]]></title>
      <guid>http://www.phpdeveloper.org/news/9687</guid>
      <link>http://www.phpdeveloper.org/news/9687</link>
      <description><![CDATA[<p>
In dealing with a little JSON encoding and objects in a project of his recently, <i>Cal Evans</i> <a href="http://blog.calevans.com/2008/02/21/zend_jsonencode-and-wth-are-all-my-properties/">bumped against a problem</a> when he was encoding an object and moving it back and forth between the back and front ends.
</p>
<blockquote>
The problem is simple, JSON encode a PHP object and send it back to the front end. Sounds simple and the last 100 times I wrote this code it was simple. This time, I was too smart for my own good. Here's the scenario.
</blockquote>
<p>
He illustrates his problem - the "dropping" of properties somewhere along the way - with a sample class that encodes the object and sends it along. He missed one key bit of information, though. His protected array of properties wasn't getting passed back out correctly and we're in the resulting JSON message. A quick hack of a getProperties() function call made this problem a thing of the past.
</p>]]></description>
      <pubDate>Fri, 22 Feb 2008 12:10:00 -0600</pubDate>
    </item>
  </channel>
</rss>
