<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>A River of Words - PHP</title>
    <link>http://blog.joeysmith.com/</link>
    <description>Drowning In Stupid</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.4.1 - http://www.s9y.org/</generator>
    <pubDate>Wed, 13 Aug 2008 05:51:04 GMT</pubDate>

    <image>
        <url>http://blog.joeysmith.com/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: A River of Words - PHP - Drowning In Stupid</title>
        <link>http://blog.joeysmith.com/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>XMLReader punts on clone</title>
    <link>http://blog.joeysmith.com/8.html</link>
            <category>PHP</category>
    
    <comments>http://blog.joeysmith.com/8.html#comments</comments>
    <wfw:comment>http://blog.joeysmith.com/wfwcomment.php?cid=8</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.joeysmith.com/rss.php?version=2.0&amp;type=comments&amp;cid=8</wfw:commentRss>
    

    <author>nospam@example.com (TML)</author>
    <content:encoded>
    	&lt;p&gt;PHP5&amp;#8217;s &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/php.net/xmlreader&#039;);&quot;  href=&quot;http://php.net/xmlreader&quot;&gt;XMLReader&lt;/a&gt; &amp;#8211; which I used for my &lt;a href=&quot;http://blog.joeysmith.com/5.html&quot;&gt;JSON-Like XML&lt;/a&gt; post, doesn&amp;#8217;t implement a &amp;#8216;clone&amp;#8217; handler, which came as quite a shock when I attempted to implement a wrapper class that would allow me to push values back into the stream when I had to read-ahead to implement &amp;#8216;nested data structures&amp;#8217; as suggested by Davey. I had a hard time finding a good example of how to internally implement clone (even &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/safari.oreilly.com/067232704X&#039;);&quot;  href=&quot;http://safari.oreilly.com/067232704X&quot;&gt;Sara Golemon&amp;#8217;s book&lt;/a&gt; only gives it a brief mention&lt;sup class=&quot;footnote&quot;&gt;&lt;a href=&quot;#fn10389234934b97ff316e8f8&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;), but I finally &lt;a href=&quot;http://blog.joeysmith.com/pages/clone.html&quot;&gt;came up with something&lt;/a&gt; &amp;#8211; I&amp;#8217;m building it now to see how well it works, or even if it works at all.&lt;/p&gt;

	&lt;p id=&quot;fn10389234934b97ff316e8f8&quot; class=&quot;footnote&quot;&gt;&lt;sup&gt;1&lt;/sup&gt; zend_object_value clone_obj(zval *object TSRMLS_DC) &amp;#8211; Used to generate a new object copied from an already instantiated one. The default behavior is to create a new object instance, associate the original&amp;#8217;s handler table with it, copy the properties table and, if the class entry for the object in question defines a __clone() method, call that to allow the new object to perform additional duplication work.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Tue, 12 Aug 2008 23:12:32 -0600</pubDate>
    <guid isPermaLink="false">http://blog.joeysmith.com/8.html</guid>
    
</item>
<item>
    <title>JSON-like XML</title>
    <link>http://blog.joeysmith.com/5.html</link>
            <category>PHP</category>
    
    <comments>http://blog.joeysmith.com/5.html#comments</comments>
    <wfw:comment>http://blog.joeysmith.com/wfwcomment.php?cid=5</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://blog.joeysmith.com/rss.php?version=2.0&amp;type=comments&amp;cid=5</wfw:commentRss>
    

    <author>nospam@example.com (TML)</author>
    <content:encoded>
    	&lt;p&gt;#phpc on Freenode had a discussion tonight about how there&amp;#8217;s nothing in &lt;span class=&quot;caps&quot;&gt;XML&lt;/span&gt; that&amp;#8217;s quite as simple as &lt;span class=&quot;caps&quot;&gt;JSON&lt;/span&gt; for encoding types. I came up with this off-the-cuff &amp;#8211; as opposed to &lt;span class=&quot;caps&quot;&gt;WDDX&lt;/span&gt;, this is more JSON-like in that each &amp;#8216;&lt;span class=&quot;caps&quot;&gt;XML&lt;/span&gt; Document&amp;#8217; encodes only a single value &amp;#8211; but that value might be mapped to any of the built-in types.&lt;br /&gt;
Of course, the &amp;lt;object&gt; stuff would only work with pretty simple objects &amp;#8211; but the fact that it tries at all to instance a class is a step beyond what &lt;span class=&quot;caps&quot;&gt;JSON&lt;/span&gt; does, which is &lt;span class=&quot;caps&quot;&gt;ALWAYS&lt;/span&gt; an instance of stdClass. You could drop this extra &amp;#8216;feature&amp;#8217; by &lt;del&gt;remove&lt;/del&gt; removing line 43 ($class = ...) and changing line 44 to:&lt;br /&gt;
&lt;pre style=&quot;font-size:9pt;&quot;&gt;&lt;span style=&quot;color:#0000ff&quot;&gt;$data&lt;/span&gt; &lt;span style=&quot;color:#000000&quot;&gt;=&lt;/span&gt; new stdClass&lt;span style=&quot;color:#000000&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;/pre&gt;&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://blog.joeysmith.com/5.html#extended&quot;&gt;Continue reading &quot;JSON-like XML&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Sun, 10 Aug 2008 22:01:40 -0600</pubDate>
    <guid isPermaLink="false">http://blog.joeysmith.com/5.html</guid>
    
</item>
<item>
    <title>Refinement of ringBuffer</title>
    <link>http://blog.joeysmith.com/4.html</link>
            <category>PHP</category>
    
    <comments>http://blog.joeysmith.com/4.html#comments</comments>
    <wfw:comment>http://blog.joeysmith.com/wfwcomment.php?cid=4</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.joeysmith.com/rss.php?version=2.0&amp;type=comments&amp;cid=4</wfw:commentRss>
    

    <author>nospam@example.com (TML)</author>
    <content:encoded>
    	&lt;p&gt;&lt;pre style=&quot;font-size:9pt;&quot;&gt;    public &lt;span style=&quot;color:#9c20ee; font-weight:bold&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color:#000000&quot;&gt;offsetSet&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#0000ff&quot;&gt;$key&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color:#0000ff&quot;&gt;$value&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;) {&lt;/span&gt;
        &lt;span style=&quot;color:#9c20ee; font-weight:bold&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color:#000000&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#0000ff&quot;&gt;$key&lt;/span&gt; &lt;span style=&quot;color:#000000&quot;&gt;===&lt;/span&gt; NULL&lt;span style=&quot;color:#000000&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color:#9c20ee; font-weight:bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color:#0000ff&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#0000ff&quot;&gt;$value&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;);&lt;/span&gt;
        &lt;span style=&quot;color:#0000ff&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;throwEx&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#9c20ee; font-weight:bold&quot;&gt;array&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#bd8d8b&quot;&gt;&amp;#8216;Do not directly set indices in a %s, use push() instead&amp;#8217;&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;,&lt;/span&gt; &lt;i&gt;CLASS&lt;/i&gt;&lt;span style=&quot;color:#000000&quot;&gt;));&lt;/span&gt;
        &lt;span style=&quot;color:#9c20ee; font-weight:bold&quot;&gt;return&lt;/span&gt; false&lt;span style=&quot;color:#000000&quot;&gt;;&lt;/span&gt;
    &lt;span style=&quot;color:#000000&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;/pre&gt; This allows the use of PHP&amp;#8217;s &amp;#8216;push&amp;#8217; syntax: $foo[] = &amp;#8216;bar&amp;#8217;;&lt;br /&gt;
Full class after the jump.&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://blog.joeysmith.com/4.html#extended&quot;&gt;Continue reading &quot;Refinement of ringBuffer&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Sat, 09 Aug 2008 14:38:32 -0600</pubDate>
    <guid isPermaLink="false">http://blog.joeysmith.com/4.html</guid>
    
</item>
<item>
    <title>Using SPL to implement a ringBuffer</title>
    <link>http://blog.joeysmith.com/3.html</link>
            <category>PHP</category>
    
    <comments>http://blog.joeysmith.com/3.html#comments</comments>
    <wfw:comment>http://blog.joeysmith.com/wfwcomment.php?cid=3</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.joeysmith.com/rss.php?version=2.0&amp;type=comments&amp;cid=3</wfw:commentRss>
    

    <author>nospam@example.com (TML)</author>
    <content:encoded>
    	&lt;p&gt;I liked the &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/php.net/spl&#039;);&quot;  href=&quot;http://php.net/spl&quot;&gt;SPL&lt;/a&gt; I used in my last post, so I cracked open my &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/oreilly.com/catalog/9780596001674/&#039;);&quot;  href=&quot;http://oreilly.com/catalog/9780596001674/&quot;&gt;Python Cookbook&lt;/a&gt; to a random location and decided to try and implement whatever it landed on in &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; using &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/php.net/spl&#039;);&quot;  href=&quot;http://php.net/spl&quot;&gt;SPL&lt;/a&gt; &amp;#8211; that led to the following implementation of a &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/en.wikipedia.org/wiki/Circular_buffer&#039;);&quot;  href=&quot;http://en.wikipedia.org/wiki/Circular_buffer&quot; target=&quot;_blank&quot;&gt;ring buffer&lt;/a&gt;.&lt;br /&gt;
There certain may be better ways to do it, but this was my first pass, and I think it behaves much how you&amp;#8217;d expect a &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/en.wikipedia.org/wiki/Circular_buffer&#039;);&quot;  href=&quot;http://en.wikipedia.org/wiki/Circular_buffer&quot; target=&quot;_blank&quot;&gt;ring buffer&lt;/a&gt; to.&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://blog.joeysmith.com/3.html#extended&quot;&gt;Continue reading &quot;Using SPL to implement a ringBuffer&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Fri, 08 Aug 2008 15:39:18 -0600</pubDate>
    <guid isPermaLink="false">http://blog.joeysmith.com/3.html</guid>
    
</item>
<item>
    <title>Case-insensitive Array access in PHP</title>
    <link>http://blog.joeysmith.com/2.html</link>
            <category>PHP</category>
    
    <comments>http://blog.joeysmith.com/2.html#comments</comments>
    <wfw:comment>http://blog.joeysmith.com/wfwcomment.php?cid=2</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://blog.joeysmith.com/rss.php?version=2.0&amp;type=comments&amp;cid=2</wfw:commentRss>
    

    <author>nospam@example.com (TML)</author>
    <content:encoded>
    	&lt;p&gt;Someone in ##&lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; was looking for an array that had &amp;#8216;case-insensitive&amp;#8217; keys, so I threw this together using &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/php.net/spl/&#039;);&quot;  href=&quot;http://php.net/spl/&quot;&gt;SPL&lt;/a&gt; &lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://blog.joeysmith.com/2.html#extended&quot;&gt;Continue reading &quot;Case-insensitive Array access in PHP&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Thu, 07 Aug 2008 21:21:48 -0600</pubDate>
    <guid isPermaLink="false">http://blog.joeysmith.com/2.html</guid>
    
</item>

</channel>
</rss>