<?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>Stubblog - Planet PHP</title>
    <link>http://www.stubbles.org/</link>
    <description>Less slogan, more code.</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.1 - http://www.s9y.org/</generator>
    <pubDate>Tue, 27 May 2008 20:43:04 GMT</pubDate>

    <image>
        <url>http://www.stubbles.org/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: Stubblog - Planet PHP - Less slogan, more code.</title>
        <link>http://www.stubbles.org/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>JSON-RPC Proxy Generation with PHP</title>
    <link>http://www.stubbles.org/archives/46-JSON-RPC-Proxy-Generation-with-PHP.html</link>
            <category>Conferences</category>
            <category>Planet PHP</category>
    
    <comments>http://www.stubbles.org/archives/46-JSON-RPC-Proxy-Generation-with-PHP.html#comments</comments>
    <wfw:comment>http://www.stubbles.org/wfwcomment.php?cid=46</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://www.stubbles.org/rss.php?version=2.0&amp;type=comments&amp;cid=46</wfw:commentRss>
    

    <author>nospam@example.com (Stephan Schmidt)</author>
    <content:encoded>
    Today I gave a talk about JSON-RPC Proxy Generation with PHP at the &lt;a href=&quot;http://www.stubbles.org/exit.php?url_id=307&amp;amp;entry_id=46&quot;  onmouseover=&quot;window.status=&#039;http://it-republik.de/conferences/dlw-europe/&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;  title=&quot;DLW Europe Website&quot;&gt;Dynamic Languages World Europe 2008&lt;/a&gt; in Karlsruhe Germany. The presentation covers an introduction to the Proxy and Remote Proxy Design Patterns, JSON in JavaScript and PHP as well as the JSON-RPC protocol specification. Furthermore, the slides also cover the SMD specifications and show how to generate SMD with PHP.&lt;br /&gt;
&lt;br /&gt;
Although Stubbles provides a ready-to-use processor for JSON-RPC and generating JavaScript proxy classes, the presentation takes you through all necessary steps that are needed to implement this on your own. &lt;br /&gt;
&lt;br /&gt;
&lt;object style=&quot;margin:0px&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://static.slideshare.net/swf/ssplayer2.swf?doc=stephanschmidtjsonrpcwithphp-1211919750835076-9&quot;/&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;/&gt;&lt;param name=&quot;allowScriptAccess&quot; value=&quot;always&quot;/&gt;&lt;embed src=&quot;http://static.slideshare.net/swf/ssplayer2.swf?doc=stephanschmidtjsonrpcwithphp-1211919750835076-9&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;
&lt;br /&gt;
You can either view the presentation on &lt;a href=&quot;http://www.stubbles.org/exit.php?url_id=308&amp;amp;entry_id=46&quot;  onmouseover=&quot;window.status=&#039;http://www.slideshare.net/schst/jsonrpc-proxy-generation-with-php-5&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;  title=&quot;Presentation on slideshare.net&quot;&gt;slideshare.net&lt;/a&gt;, or get the PDF in our &lt;a href=&quot;http://www.stubbles.org/exit.php?url_id=309&amp;amp;entry_id=46&quot;  onmouseover=&quot;window.status=&#039;http://downloads.stubbles.net/&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;  title=&quot;Download area&quot;&gt;download area&lt;/a&gt;. If you decide to use our implementation, you can find more information in the &lt;a href=&quot;http://www.stubbles.org/exit.php?url_id=310&amp;amp;entry_id=46&quot;  onmouseover=&quot;window.status=&#039;http://www.stubbles.net/wiki/Docs/JsonRpc&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;  title=&quot;JSON-RPC documentation in the manual&quot;&gt;Stubbles manual&lt;/a&gt;. 
    </content:encoded>

    <pubDate>Tue, 27 May 2008 22:31:11 +0200</pubDate>
    <guid isPermaLink="false">http://www.stubbles.org/archives/46-guid.html</guid>
    
</item>
<item>
    <title>Searching for a new job?</title>
    <link>http://www.stubbles.org/archives/44-Searching-for-a-new-job.html</link>
            <category>Planet PHP</category>
    
    <comments>http://www.stubbles.org/archives/44-Searching-for-a-new-job.html#comments</comments>
    <wfw:comment>http://www.stubbles.org/wfwcomment.php?cid=44</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.stubbles.org/rss.php?version=2.0&amp;type=comments&amp;cid=44</wfw:commentRss>
    

    <author>nospam@example.com (Frank Kleine)</author>
    <content:encoded>
    Ìn case you are interested in a new job and speak german: Read on after the break. &lt;br /&gt;&lt;a href=&quot;http://www.stubbles.org/archives/44-Searching-for-a-new-job.html#extended&quot;&gt;Continue reading &quot;Searching for a new job?&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Tue, 11 Mar 2008 16:56:59 +0100</pubDate>
    <guid isPermaLink="false">http://www.stubbles.org/archives/44-guid.html</guid>
    
</item>
<item>
    <title>Traits for PHP</title>
    <link>http://www.stubbles.org/archives/42-Traits-for-PHP.html</link>
            <category>Planet PHP</category>
    
    <comments>http://www.stubbles.org/archives/42-Traits-for-PHP.html#comments</comments>
    <wfw:comment>http://www.stubbles.org/wfwcomment.php?cid=42</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://www.stubbles.org/rss.php?version=2.0&amp;type=comments&amp;cid=42</wfw:commentRss>
    

    <author>nospam@example.com (Frank Kleine)</author>
    <content:encoded>
    Just stumbled over a &lt;a href=&quot;http://www.stubbles.org/exit.php?url_id=279&amp;amp;entry_id=42&quot; title=&quot;http://news.php.net/php.internals/35562&quot;  onmouseover=&quot;window.status=&#039;http://news.php.net/php.internals/35562&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;proposal for traits in PHP&lt;/a&gt;, proposed by &lt;a href=&quot;http://www.stubbles.org/exit.php?url_id=280&amp;amp;entry_id=42&quot; title=&quot;http://stefan-marr.de/archives/16-Traits-for-PHP.html&quot;  onmouseover=&quot;window.status=&#039;http://stefan-marr.de/archives/16-Traits-for-PHP.html&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;Stefan Marr&lt;/a&gt;. Being a bit sceptical at first I came to the conclusion that this would be a really useful feature - and save us a bunch of doubled code in Stubbles. After reading the RFC until the end I noticed that I saw a similar concept some weeks before in Java: &lt;a href=&quot;http://www.stubbles.org/exit.php?url_id=281&amp;amp;entry_id=42&quot; title=&quot;http://www.qi4j.org/&quot;  onmouseover=&quot;window.status=&#039;http://www.qi4j.org/&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;Qi4J&lt;/a&gt; tries to achieve the same, but requires very much code to get this done. As a language construct within PHP it would be very easy to do the same, but easier to learn and to use. Beside some keyword issues (the RFC uses &quot;use&quot; as keyword, but this will of course conflict with &lt;a href=&quot;http://www.stubbles.org/exit.php?url_id=282&amp;amp;entry_id=42&quot; title=&quot;http://php.net/manual/en/language.namespaces.using.php&quot;  onmouseover=&quot;window.status=&#039;http://php.net/manual/en/language.namespaces.using.php&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;namespaces&lt;/a&gt;) I&#039;m wondering what this will have an impact on reflection - the RFC stays unclear about this. What do I get when reflecting a method from a trait, or a method in a class that originally comes out of a trait?&lt;br /&gt;
&lt;br /&gt;
However I&#039;m not very confident that this feature will make its way into PHP - maybe I&#039;ve read to much internals... 
    </content:encoded>

    <pubDate>Mon, 18 Feb 2008 22:04:37 +0100</pubDate>
    <guid isPermaLink="false">http://www.stubbles.org/archives/42-guid.html</guid>
    
</item>
<item>
    <title>Do not trust the reflection API</title>
    <link>http://www.stubbles.org/archives/40-Do-not-trust-the-reflection-API.html</link>
            <category>Planet PHP</category>
    
    <comments>http://www.stubbles.org/archives/40-Do-not-trust-the-reflection-API.html#comments</comments>
    <wfw:comment>http://www.stubbles.org/wfwcomment.php?cid=40</wfw:comment>

    <slash:comments>6</slash:comments>
    <wfw:commentRss>http://www.stubbles.org/rss.php?version=2.0&amp;type=comments&amp;cid=40</wfw:commentRss>
    

    <author>nospam@example.com (Frank Kleine)</author>
    <content:encoded>
    At least if it comes to internal classes. If you try to get informations about parameters from methods of internal classes - forget that. Examining several internal classes my key findings are: either there is no information about parameters available and the reflection API says the method does not have any parameters, or the information about the parameter is wrong. Some examples I retrieved with the following script:&lt;br /&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.stubbles.org/archives/40-Do-not-trust-the-reflection-API.html#extended&quot;&gt;Continue reading &quot;Do not trust the reflection API&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Sat, 26 Jan 2008 13:28:57 +0100</pubDate>
    <guid isPermaLink="false">http://www.stubbles.org/archives/40-guid.html</guid>
    
</item>
<item>
    <title>vfsStream 0.3.0 and good bye SimpleTest</title>
    <link>http://www.stubbles.org/archives/39-vfsStream-0.3.0-and-good-bye-SimpleTest.html</link>
            <category>Planet PHP</category>
            <category>vfsStream</category>
    
    <comments>http://www.stubbles.org/archives/39-vfsStream-0.3.0-and-good-bye-SimpleTest.html#comments</comments>
    <wfw:comment>http://www.stubbles.org/wfwcomment.php?cid=39</wfw:comment>

    <slash:comments>3</slash:comments>
    <wfw:commentRss>http://www.stubbles.org/rss.php?version=2.0&amp;type=comments&amp;cid=39</wfw:commentRss>
    

    <author>nospam@example.com (Frank Kleine)</author>
    <content:encoded>
    Against my intent of starting to work on file modes for 0.3.0 I decided that it is time to get an own repository for &lt;a href=&quot;http://www.stubbles.org/exit.php?url_id=272&amp;amp;entry_id=39&quot; title=&quot;http://vfs.bovigo.org/&quot;  onmouseover=&quot;window.status=&#039;http://vfs.bovigo.org/&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;vfsStream&lt;/a&gt; in order to maintain it independently from Stubbles, which was the perfect reason to open a new project on Google Code. I will see if this proves to be a good solution for day to day development.&lt;br /&gt;
&lt;br /&gt;
The movement also marked the reason to try PHPUnit because I wanted to make use of its code coverage and its software metrics features. Especially the last one showed me a bunch of points that required refactoring before starting something big like supporting file modes. During refactoring some improvements made it into the code which justified a new release: vfsStream now supports rmdir(), and I made some API changes. I dropped vfsStreamDirectory::ceate() in favor of vfsStream::newDirectory() to be equivalent to vfsStream::newFile(). Additionally there is a new vfsStreamContent::at() method now, which allows to write code like this:&lt;br /&gt;
&lt;code&gt;
$parentDir = vfsStream::newDirectory(&#039;newdir&#039;)-&gt;at(vfsStreamWrapper::getRoot());
$file = vfsStream::newFile(&#039;file.txt&#039;)-&gt;withContent(&#039;foo&#039;)
                                      -&gt;lastModified(time() - 86400)
                                      -&gt;at($parentDir);
&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
So far I&#039;m very satisfied with the software analysis features of PHPUnit that I&#039;m thinking very hard about saying good bye to SimpleTest in my other projects. Given the current state of SimpleTest&#039;s development I do not expect to get similar features in SimpleTest any time soon, and unfortunately I do not have the time to contribute to SimpleTest even if it would be a lot of fun I guess. 
    </content:encoded>

    <pubDate>Wed, 02 Jan 2008 23:46:00 +0100</pubDate>
    <guid isPermaLink="false">http://www.stubbles.org/archives/39-guid.html</guid>
    
</item>
<item>
    <title>vfsStream 0.2.0 released</title>
    <link>http://www.stubbles.org/archives/37-vfsStream-0.2.0-released.html</link>
            <category>Planet PHP</category>
            <category>vfsStream</category>
    
    <comments>http://www.stubbles.org/archives/37-vfsStream-0.2.0-released.html#comments</comments>
    <wfw:comment>http://www.stubbles.org/wfwcomment.php?cid=37</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://www.stubbles.org/rss.php?version=2.0&amp;type=comments&amp;cid=37</wfw:commentRss>
    

    <author>nospam@example.com (Frank Kleine)</author>
    <content:encoded>
    Having done more work on &lt;a href=&quot;http://www.stubbles.org/exit.php?url_id=257&amp;amp;entry_id=37&quot; title=&quot;http://vfs.bovigo.org/&quot;  onmouseover=&quot;window.status=&#039;http://vfs.bovigo.org/&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;vfsStream&lt;/a&gt; I felt it is time to do the next release before starting to work on the next big issue&amp;#8482;. The new 0.2.0 release focuses on API improvements as well as support for differentiating between directories and files. API improvements are a new vfsStream::url() method to assist in creating correct vfsStream urls. Up until now you had to write something like&lt;br /&gt;
&lt;code&gt;$url = vfsStreamWrapper::PROTOCOL . &#039;://path/to/file.txt&#039;;&lt;/code&gt;&lt;br /&gt;
which is kind of ugly and unhandy to type. Now you can do&lt;br /&gt;
&lt;code&gt;$url = vfsStream::url(&#039;path/to/file.txt&#039;);&lt;/code&gt; which should be easier and less to type.&lt;br /&gt;
Another API improvement is the new vfsStream::newFile() method to be able to do&lt;br /&gt;
&lt;code&gt;$file = vfsStream::newFile(&quot;foo.txt&quot;)-&gt;withContent(&quot;bar&quot;);&lt;/code&gt;&lt;br /&gt;
Following an advice by David Zülke I changed vfsStreamWrapper::register() to reset the directory root to null.&lt;br /&gt;
&lt;br /&gt;
Additionally vfsStream now supports is_dir(), is_file() and is_readable(). However there is still a small drawback to is_readable(), as long as file mode is not supported existing pathes will lead to true, and non-existing pathes to false. Currently all files and directories always have 0777 as file mode. As I require support for file modes now this will be part of the 0.3.0 release.&lt;br /&gt;
&lt;br /&gt;
Another thing I found during the last days is that realpath() seems only to work with real files, but not with any other URL types. That&#039;s a bit sad because it means one can not use this function if one wants to test its file operations with vfsStream. 
    </content:encoded>

    <pubDate>Sat, 29 Dec 2007 14:33:58 +0100</pubDate>
    <guid isPermaLink="false">http://www.stubbles.org/archives/37-guid.html</guid>
    
</item>
<item>
    <title>vfsStream 0.1.0 released</title>
    <link>http://www.stubbles.org/archives/36-vfsStream-0.1.0-released.html</link>
            <category>Planet PHP</category>
            <category>vfsStream</category>
    
    <comments>http://www.stubbles.org/archives/36-vfsStream-0.1.0-released.html#comments</comments>
    <wfw:comment>http://www.stubbles.org/wfwcomment.php?cid=36</wfw:comment>

    <slash:comments>8</slash:comments>
    <wfw:commentRss>http://www.stubbles.org/rss.php?version=2.0&amp;type=comments&amp;cid=36</wfw:commentRss>
    

    <author>nospam@example.com (Frank Kleine)</author>
    <content:encoded>
    Some minutes ago I released the first version of &lt;a href=&quot;http://www.stubbles.org/exit.php?url_id=258&amp;amp;entry_id=36&quot; title=&quot;http://vfs.bovigo.org/&quot;  onmouseover=&quot;window.status=&#039;http://vfs.bovigo.org/&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;vfsStream&lt;/a&gt;. vfsStream is a stream wrapper for a virtual file system that may be helpful in unit tests to mock the real file system. It can be used with any unit test framework, like &lt;a href=&quot;http://www.stubbles.org/exit.php?url_id=259&amp;amp;entry_id=36&quot; title=&quot;http://phpunit.de/&quot;  onmouseover=&quot;window.status=&#039;http://phpunit.de/&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;PHPUnit&lt;/a&gt; or &lt;a href=&quot;http://www.stubbles.org/exit.php?url_id=260&amp;amp;entry_id=36&quot; title=&quot;http://simpletest.org/&quot;  onmouseover=&quot;window.status=&#039;http://simpletest.org/&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;SimpleTest&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
The first idea for this came up when I prepared my talk about stream wrappers for the &lt;a href=&quot;http://www.stubbles.org/exit.php?url_id=261&amp;amp;entry_id=36&quot; title=&quot;http://phpconference.com/&quot;  onmouseover=&quot;window.status=&#039;http://phpconference.com/&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;PHP conference&lt;/a&gt; in Frankfurt-Mörfelden earlier this year (&lt;a href=&quot;http://www.stubbles.org/exit.php?url_id=262&amp;amp;entry_id=36&quot; title=&quot;http://downloads.stubbles.net/&quot;  onmouseover=&quot;window.status=&#039;http://downloads.stubbles.net/&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;slides still available&lt;/a&gt;). Everybody knows that you should not use real databases in unit tests, so why should one use the real file system? Of course you can create an IO abstraction layer, but PHP offers such easy access to file contents via its file_get_content() and file_put_content() functions as well as with its other file system functions that it would be a bit overdone to create such a layer just for testing purposes. Additionally there are stream wrappers which allow you to create your own protocol and use it with exactly this file functions.&lt;br /&gt;
&lt;br /&gt;
This was the point where I started thinking about it, so hacked together a first version as a prove-of-concept. Because it worked like a charm I started to use it in my own unit tests, which already saved me some time and problems. Today I decided it is time to release this as open source to the public to see if other people like the idea and have a use for it, therefore I did some refactorings, and did a first release. Unfortunately not everything works by now: It is currently not possible to rename a file or directory, and it is not possible to remove directories. Additionally file modes are completely ignored. The main reason for this is that I did not need one of this features until now. Feel free to send patches, wait until I have a need for it or beg me to implement them. &lt;img src=&quot;http://www.stubbles.org/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt; 
    </content:encoded>

    <pubDate>Fri, 14 Dec 2007 00:31:31 +0100</pubDate>
    <guid isPermaLink="false">http://www.stubbles.org/archives/36-guid.html</guid>
    
</item>
<item>
    <title>Tricky namespaces? No.</title>
    <link>http://www.stubbles.org/archives/35-Tricky-namespaces-No..html</link>
            <category>Planet PHP</category>
    
    <comments>http://www.stubbles.org/archives/35-Tricky-namespaces-No..html#comments</comments>
    <wfw:comment>http://www.stubbles.org/wfwcomment.php?cid=35</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://www.stubbles.org/rss.php?version=2.0&amp;type=comments&amp;cid=35</wfw:commentRss>
    

    <author>nospam@example.com (Frank Kleine)</author>
    <content:encoded>
    So I put down this &lt;a href=&quot;http://www.stubbles.org/exit.php?url_id=243&amp;amp;entry_id=35&quot; title=&quot;http://www.stubbles.org/archives/34-Tricky-namespaces.html&quot;  onmouseover=&quot;window.status=&#039;http://www.stubbles.org/archives/34-Tricky-namespaces.html&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;namespace examples&lt;/a&gt; together last night. But, what&#039;s happening in the examples regarding to resolution rules? (I won&#039;t post the code here again, have a look at the &lt;a href=&quot;http://www.stubbles.org/exit.php?url_id=243&amp;amp;entry_id=35&quot; title=&quot;http://www.stubbles.org/archives/34-Tricky-namespaces.html&quot;  onmouseover=&quot;window.status=&#039;http://www.stubbles.org/archives/34-Tricky-namespaces.html&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;last entry for the example code&lt;/a&gt;.)&lt;br /&gt;
&lt;br /&gt;
Version 1 and 2 two are the same, the place where we include other code does not influence naming rules in the current file. Why do we get instances of PHP&#039;s internal DateTime class instead of the one from Name::Space? Well, two things have to be considered:&lt;br /&gt;
1. We are in the global space, PHP will only look for DateTime in the global space.&lt;br /&gt;
2. The use-Statement declares that we want to create a shortcut to Name::Space, not to Name::Space::DateTime. If we wanted to use the class from Name::Space we would need to write $d = new Space::DateTime, which is version 3.&lt;br /&gt;
(We can not do a use Name::Space::DateTime here, this results in a fatal error. However, we could do use Name::Space::DateTime as DT and then write $d = new DT(), this will give instances of Name::Space::DateTime.)&lt;br /&gt;
&lt;br /&gt;
With version 4 we have put our example code into its own namespace, but the result is still the same as in version 1 and 2. What&#039;s happening?&lt;br /&gt;
1. We are in namespace foo, and in namespace foo no class DateTime exists.&lt;br /&gt;
2. Our shortcut use Name::Space still does not refer to Name::Space::DateTime, to create instances from this class we still need to write $d = new Space::DateTime as in version 5. This means the class does not apply either in version 4.&lt;br /&gt;
3. As no further use declarations exist, PHP falls back to its internal DateTime class. (If this class would not exist, a call to the registered autoload function would be issued.)&lt;br /&gt;
&lt;br /&gt;
Finally, version 6 gives the result we originally intended: The class Name::Space::DateTime is used instead of PHP&#039;s internal class. This is because we stated in the use declaration that we want to use Name::Space::DateTime as DateTime.&lt;br /&gt;
&lt;br /&gt;
However, in the original posting of David Zülke in php internals he feared that the two instances of $d might be from different classes. Well, this might really happen under some circumstances. More after the break... &lt;br /&gt;&lt;a href=&quot;http://www.stubbles.org/archives/35-Tricky-namespaces-No..html#extended&quot;&gt;Continue reading &quot;Tricky namespaces? No.&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Wed, 12 Dec 2007 09:38:36 +0100</pubDate>
    <guid isPermaLink="false">http://www.stubbles.org/archives/35-guid.html</guid>
    
</item>
<item>
    <title>Tricky namespaces</title>
    <link>http://www.stubbles.org/archives/34-Tricky-namespaces.html</link>
            <category>Planet PHP</category>
    
    <comments>http://www.stubbles.org/archives/34-Tricky-namespaces.html#comments</comments>
    <wfw:comment>http://www.stubbles.org/wfwcomment.php?cid=34</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://www.stubbles.org/rss.php?version=2.0&amp;type=comments&amp;cid=34</wfw:commentRss>
    

    <author>nospam@example.com (Frank Kleine)</author>
    <content:encoded>
    Today on php-internals David Zülke posted an interesting example with namespaces which made me think about the result of the small example. Well, my first guess was not right as my experiments showed. Therefore I tried different versions of the example to see the impact of namespace and use declarations. But first, the example:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;
Name/Space/DateTime.php
  namespace Name::Space;

  class DateTime {}

Name/Space/Ship.php
  namespace Name::Space;

  class Ship {
    public static function __autoload($className) {
      echo &quot;loading $className\n&quot;;
      // ... autoloader, can load Name::Space::DateTime
    }
  }

somestuff.php
  function someStuffWeDoNotHaveControlOver() {
    $foo = new Name::Space::DateTime();
    var_dump($foo);
    // ...
  }

setup.php
  require_once(&#039;Name/Space/Ship.php&#039;);
  spl_autoload_register(array(&#039;Name::Space::Ship&#039;, &#039;__autoload&#039;));
&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
Version 1, the original from David&#039;s posting:&lt;br /&gt;
&lt;code&gt;
require_once(&#039;setup.php&#039;);
use Name::Space;
$d = new DateTime();
var_dump($d);
require_once(&#039;somestuff.php&#039;); // assumed to be here, was missing in the given example
someStuffWeDoNotHaveControlOver();
$d = new DateTime();
var_dump($d);
&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
object(DateTime)#1 (0) {&lt;br /&gt;
}&lt;br /&gt;
loading Name::Space::DateTime&lt;br /&gt;
object(Name::Space::DateTime)#2 (0) {&lt;br /&gt;
}&lt;br /&gt;
object(DateTime)#2 (0) {&lt;br /&gt;
}&lt;br /&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
More after the break... &lt;br /&gt;&lt;a href=&quot;http://www.stubbles.org/archives/34-Tricky-namespaces.html#extended&quot;&gt;Continue reading &quot;Tricky namespaces&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Wed, 12 Dec 2007 01:23:11 +0100</pubDate>
    <guid isPermaLink="false">http://www.stubbles.org/archives/34-guid.html</guid>
    
</item>
<item>
    <title>Gathering practical experience with namespaces</title>
    <link>http://www.stubbles.org/archives/33-Gathering-practical-experience-with-namespaces.html</link>
            <category>Planet PHP</category>
    
    <comments>http://www.stubbles.org/archives/33-Gathering-practical-experience-with-namespaces.html#comments</comments>
    <wfw:comment>http://www.stubbles.org/wfwcomment.php?cid=33</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://www.stubbles.org/rss.php?version=2.0&amp;type=comments&amp;cid=33</wfw:commentRss>
    

    <author>nospam@example.com (Frank Kleine)</author>
    <content:encoded>
    Being a little bit bored today I started to port &lt;a href=&quot;http://www.stubbles.org/exit.php?url_id=240&amp;amp;entry_id=33&quot; title=&quot;http://php.xjconf.net/&quot;  onmouseover=&quot;window.status=&#039;http://php.xjconf.net/&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;XJConf&lt;/a&gt; to PHP 5.3 using namespaces. Oh boy. You should never even think about porting your application completely to namespaces if you do not have enough unit tests! Consider something like this:&lt;br /&gt;
&lt;code&gt;
if (get_class($instance) == $someClassName) {
   // do this
}
&lt;/code&gt;&lt;br /&gt;
It is most likely that $someClassName does contain the name of the class only without the namespace prefix. As get_class() now returns the full qualified class name this comparison will fail - you need to make sure that $someClassName contains the full qualified class name. I&#039;m sure there is a lot of code out there like this or similar.&lt;br /&gt;
&lt;br /&gt;
Another point is that you should not import classes from the same namespace, I had a situation where this lead to a fatal error because of loading the same class twice, however I was not able to create a reproducable test case after I solved the problem.&lt;br /&gt;
&lt;br /&gt;
As I said I would not recommend the transition without unit tests, but you have to adjust them as well. For XJConf I just had to change two things (I&#039;m using SimpleTest):&lt;br /&gt;
&lt;br /&gt;
1. expectException() requires the full qualified class name of the expected exception now&lt;br /&gt;
&lt;br /&gt;
2. creating mock objects: Mock::generate(&#039;Tag&#039;); needs to be changed to Mock::generate(&#039;net::xjconf::Tag&#039;, &#039;MockTag&#039;); to enable SimpleTest finding the correct class (full qualified class name), additionally you need to state a class name for the mock class to be created, else SimpleTest will fail to create the mock class because it would produce something like Mocknet::xjconf::Tag which of course results in a parse error.&lt;br /&gt;
&lt;br /&gt;
Finally __autoload() makes really fun now. It receives the full qualified class name as argument, it is a simple task to change this into the correct path to the class file. If you do not use it until now due to the quirks required when not using class names like My_Application_Has_Really_Really_Long_Class_Names you should really consider using it after migrating your application to namespaces. 
    </content:encoded>

    <pubDate>Sun, 11 Nov 2007 17:09:00 +0100</pubDate>
    <guid isPermaLink="false">http://www.stubbles.org/archives/33-guid.html</guid>
    
</item>
<item>
    <title>Subtle BC break in PHP 5.2.4</title>
    <link>http://www.stubbles.org/archives/32-Subtle-BC-break-in-PHP-5.2.4.html</link>
            <category>Planet PHP</category>
    
    <comments>http://www.stubbles.org/archives/32-Subtle-BC-break-in-PHP-5.2.4.html#comments</comments>
    <wfw:comment>http://www.stubbles.org/wfwcomment.php?cid=32</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://www.stubbles.org/rss.php?version=2.0&amp;type=comments&amp;cid=32</wfw:commentRss>
    

    <author>nospam@example.com (Frank Kleine)</author>
    <content:encoded>
    Today while evaluating PHP 5.3 I stumbled about a subtle BC break which has already been introduced in PHP 5.2.4. Consider the following code:&lt;br /&gt;
&lt;code&gt;
class Bar
{
    public function dumpBar()
    {
        var_dump(get_object_vars($this));
    }
}
class Foo extends Bar
{
    public $public = &#039;public&#039;;
    protected $protected = &#039;protected&#039;;
    private $private = &#039;private&#039;;
    
    public function dump()
    {
        var_dump(get_object_vars($this));
    }
}
$foo = new Foo();
$foo-&gt;dump();
$foo-&gt;dumpBar();
&lt;/code&gt; &lt;br /&gt;&lt;a href=&quot;http://www.stubbles.org/archives/32-Subtle-BC-break-in-PHP-5.2.4.html#extended&quot;&gt;Continue reading &quot;Subtle BC break in PHP 5.2.4&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Sat, 10 Nov 2007 02:17:00 +0100</pubDate>
    <guid isPermaLink="false">http://www.stubbles.org/archives/32-guid.html</guid>
    
</item>
<item>
    <title>Slides from IPC 2007</title>
    <link>http://www.stubbles.org/archives/31-Slides-from-IPC-2007.html</link>
            <category>Planet PHP</category>
    
    <comments>http://www.stubbles.org/archives/31-Slides-from-IPC-2007.html#comments</comments>
    <wfw:comment>http://www.stubbles.org/wfwcomment.php?cid=31</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://www.stubbles.org/rss.php?version=2.0&amp;type=comments&amp;cid=31</wfw:commentRss>
    

    <author>nospam@example.com (Frank Kleine)</author>
    <content:encoded>
    I just put the slides from the presentations at the &lt;a href=&quot;http://www.stubbles.org/exit.php?url_id=230&amp;amp;entry_id=31&quot; title=&quot;http://phpconference.com/&quot;  onmouseover=&quot;window.status=&#039;http://phpconference.com/&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;International PHP Conference&lt;/a&gt; online, you can find them in our &lt;a href=&quot;http://www.stubbles.org/exit.php?url_id=231&amp;amp;entry_id=31&quot; title=&quot;http://downloads.stubbles.net/&quot;  onmouseover=&quot;window.status=&#039;http://downloads.stubbles.net/&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;downloads area&lt;/a&gt;. Unfortunately Stephan became ill some days before the conference, so I had to present the talks we intended to do together without him. However I think they went quite well and I hope everybody who listened got some new ideas for his programming work.&lt;br /&gt;
&lt;br /&gt;
Those who attended my session about Dependency Injection might be interested in our new &lt;a href=&quot;http://www.stubbles.org/exit.php?url_id=232&amp;amp;entry_id=31&quot; title=&quot;http://stubbles.net/wiki/Docs/IOC&quot;  onmouseover=&quot;window.status=&#039;http://stubbles.net/wiki/Docs/IOC&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;documentation for the Stubbles IoC container&lt;/a&gt;. It goes more into detail on how it can be used than it was possible to do in the session.&lt;br /&gt;
&lt;br /&gt;
As a side note, Robert Lemke had a very good session on &lt;a href=&quot;http://www.stubbles.org/exit.php?url_id=233&amp;amp;entry_id=31&quot; title=&quot;http://martinfowler.com/articles/injection.html&quot;  onmouseover=&quot;window.status=&#039;http://martinfowler.com/articles/injection.html&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;Dependency Injection&lt;/a&gt; and &lt;a href=&quot;http://www.stubbles.org/exit.php?url_id=234&amp;amp;entry_id=31&quot; title=&quot;http://en.wikipedia.org/wiki/Aspect-oriented_programming&quot;  onmouseover=&quot;window.status=&#039;http://en.wikipedia.org/wiki/Aspect-oriented_programming&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;AOP&lt;/a&gt; and how this is possible in the upcoming version 5.0 of the Typo3 framework. From those sessions I attended I think this was the best one. 
    </content:encoded>

    <pubDate>Thu, 08 Nov 2007 23:03:46 +0100</pubDate>
    <guid isPermaLink="false">http://www.stubbles.org/archives/31-guid.html</guid>
    
</item>
<item>
    <title>Tutorial for XJConf for PHP at IBM DeveloperWorks published</title>
    <link>http://www.stubbles.org/archives/30-Tutorial-for-XJConf-for-PHP-at-IBM-DeveloperWorks-published.html</link>
            <category>Planet PHP</category>
    
    <comments>http://www.stubbles.org/archives/30-Tutorial-for-XJConf-for-PHP-at-IBM-DeveloperWorks-published.html#comments</comments>
    <wfw:comment>http://www.stubbles.org/wfwcomment.php?cid=30</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.stubbles.org/rss.php?version=2.0&amp;type=comments&amp;cid=30</wfw:commentRss>
    

    <author>nospam@example.com (Frank Kleine)</author>
    <content:encoded>
    Just today a tutorial on &lt;a href=&quot;http://www.stubbles.org/exit.php?url_id=214&amp;amp;entry_id=30&quot;  onmouseover=&quot;window.status=&#039;http://php.xjconf.net/&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot; title=&quot;XJConf website&quot;&gt;XJConf for PHP&lt;/a&gt; was published on IBM DeveloperWorks: &lt;a href=&quot;http://www.stubbles.org/exit.php?url_id=215&amp;amp;entry_id=30&quot;  onmouseover=&quot;window.status=&#039;http://www.ibm.com/developerworks/xml/library/x-xjconf/&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot; title=&quot;Tutorial on IBM DeveloperWorks&quot;&gt;Process XML configuration files with PHP&lt;/a&gt; by Vikram Vaswani. This tutorial gives a very nice introduction into XJConf and what it is good for. I&#039;m very thankful to Vikram Vaswani because the tutorial covers very much of the XJConf basics we should already have created user documentation for but did not due to lack of time. Additionally the article comes just in time for my talk at the &lt;a href=&quot;http://www.stubbles.org/exit.php?url_id=216&amp;amp;entry_id=30&quot; title=&quot;http://phpconference.com/&quot;  onmouseover=&quot;window.status=&#039;http://phpconference.com/&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;International PHP Conference&lt;/a&gt; tomorrow morning where I will speak about Dependency Injection and how XJConf can help you with this (in parts). 
    </content:encoded>

    <pubDate>Tue, 06 Nov 2007 23:57:56 +0100</pubDate>
    <guid isPermaLink="false">http://www.stubbles.org/archives/30-guid.html</guid>
    
</item>
<item>
    <title>XJConf for PHP 0.2.0 released</title>
    <link>http://www.stubbles.org/archives/28-XJConf-for-PHP-0.2.0-released.html</link>
            <category>Planet PHP</category>
    
    <comments>http://www.stubbles.org/archives/28-XJConf-for-PHP-0.2.0-released.html#comments</comments>
    <wfw:comment>http://www.stubbles.org/wfwcomment.php?cid=28</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.stubbles.org/rss.php?version=2.0&amp;type=comments&amp;cid=28</wfw:commentRss>
    

    <author>nospam@example.com (Frank Kleine)</author>
    <content:encoded>
    Some minutes ago I released version 0.2.0 of &lt;a href=&quot;http://www.stubbles.org/exit.php?url_id=209&amp;amp;entry_id=28&quot; title=&quot;http://php.xjconf.net/&quot;  onmouseover=&quot;window.status=&#039;http://php.xjconf.net/&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;XJConf for PHP&lt;/a&gt;. XJConf allows to create simple to complex object structures from XML configuration files. Some of the new features include:&lt;br /&gt;
- abstract tags, which enable you to define the concrete type in the tag instead of the definition&lt;br /&gt;
- define an explicit setter method for character data inside a tag&lt;br /&gt;
- possibility to declare tags as static&lt;br /&gt;
- new value type &quot;xjconf:auto-primitive&quot; to guess the type of a scalar value&lt;br /&gt;
- implicit and explicit call to __set as well as possibility for setting public properties&lt;br /&gt;
- XJConfFacade for a simplified usage of XJConf&lt;br /&gt;
&lt;br /&gt;
If you are already using version 0.1.2 you should definitely upgrade to the new version, as it offers more features as well as a simplified access to XJConf itself via the new facade. 
    </content:encoded>

    <pubDate>Mon, 24 Sep 2007 21:44:04 +0200</pubDate>
    <guid isPermaLink="false">http://www.stubbles.org/archives/28-guid.html</guid>
    
</item>
<item>
    <title>Return type hints</title>
    <link>http://www.stubbles.org/archives/27-Return-type-hints.html</link>
            <category>Planet PHP</category>
    
    <comments>http://www.stubbles.org/archives/27-Return-type-hints.html#comments</comments>
    <wfw:comment>http://www.stubbles.org/wfwcomment.php?cid=27</wfw:comment>

    <slash:comments>6</slash:comments>
    <wfw:commentRss>http://www.stubbles.org/rss.php?version=2.0&amp;type=comments&amp;cid=27</wfw:commentRss>
    

    <author>nospam@example.com (Frank Kleine)</author>
    <content:encoded>
    Just stumbled about some funny PHP behaviour: obviously there is already some return-type checking implemented. &lt;img src=&quot;http://www.stubbles.org/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;br /&gt;
&lt;code&gt;
class Foo
{
    public function __toString()
    {
        return 313;
    }
}

$foo = new Foo();
echo $foo;
&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
&lt;pre&gt;Catchable fatal error: Method Foo::__toString() must return a string value in&lt;br /&gt;
E:\php\tests\__toString.php on line 11&lt;/pre&gt; 
    </content:encoded>

    <pubDate>Mon, 20 Aug 2007 00:35:42 +0200</pubDate>
    <guid isPermaLink="false">http://www.stubbles.org/archives/27-guid.html</guid>
    
</item>

</channel>
</rss>