<?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>D-talk - PHP</title>
    <link>http://blog.dynom.nl/</link>
    <description>The little things that pop into mind</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.2-beta4 - http://www.s9y.org/</generator>
    
    

<item>
    <title>Career change</title>
    <link>http://blog.dynom.nl/archives/Career-change_20130106_65.html</link>
            <category>PlanetPHP</category>
            <category>Social</category>
    
    <comments>http://blog.dynom.nl/archives/Career-change_20130106_65.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=65</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.dynom.nl/rss.php?version=2.0&amp;type=comments&amp;cid=65</wfw:commentRss>
    

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;p&gt;I started as developer in Pascal, Java and C. After noticing this interesting phenomena called the world wide web I was eager to participate. Convinced that PHP was a perfect language to quickly build web-applications, I started building websites even before the H in PHP received the &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/php.net/archive/1998.php&#039;);&quot;  mce_href=&quot;http://php.net/archive/1998.php&quot; href=&quot;http://php.net/archive/1998.php&quot;&gt;official&lt;/a&gt;meaning &quot;Hypertext&quot;.&lt;/p&gt;&lt;p&gt;After developing websites for a while, I was convinced I knew it all. I quickly stumbled upon the obvious, that I knew nothing. After learning from other developers, reading many books and constantly trying to improve myself, I found out that software-development isn&#039;t easy at all. In fact, it&#039;s very hard to do right.&lt;/p&gt;&lt;p&gt;In my 5+ years of professional experience in building large web-applications. I learned to identify many of the problems of software development. During many hours of consultancy jobs and by working at &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.ibuildings.nl&#039;);&quot;  mce_href=&quot;http://www.ibuildings.nl&quot; href=&quot;http://www.ibuildings.nl&quot;&gt;Ibuildings&lt;/a&gt;&amp;#160;(one of the best PHP companies in the world), I&#039;m able to explain and express those problems, to developers and to managers.&lt;/p&gt;&lt;p&gt;I&#039;m a developer and open-source enthousiast at heart, with real understanding of business needs. I know what drives developers, I understand managers and I know what the business wants. I&#039;m able to translate between those massively different entities.&lt;/p&gt;&lt;p&gt;I started at Ibuildings in &lt;a mce_href=&quot;http://blog.dynom.nl/archives/Ibuildings,-here-I-come-!_20080215_18.html&quot; href=&quot;/archives/Ibuildings,-here-I-come-!_20080215_18.html&quot;&gt;2008&lt;/a&gt; and I&#039;ve worked there with great pleasure, but it&#039;s time for something new. As of 2013 I will continue doing the thing I love most, as a freelance consultant.&lt;/p&gt;&lt;p&gt;I&#039;m available as a solutions architect. I can help design your new platform, I can give a second opinion on your existing infrastructure, I can help you with assessing the technical ceiling of your development team. I can help setup proper tooling to give you better insight in the quality of your products, by making quality measurable. I can review your development processes and make recommendations with the end goal, of introducing a better overal quality of code and a healthier development team.&lt;/p&gt;&lt;p&gt;I offer my services in the Netherlands, but I&#039;m always open to interesting opportunities (&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.linkedin.com/in/markvandervelden&#039;);&quot;  mce_href=&quot;https://www.linkedin.com/in/markvandervelden&quot; href=&quot;https://www.linkedin.com/in/markvandervelden&quot;&gt;My linkedin profile&lt;/a&gt;)&lt;/p&gt;&lt;p&gt;Thanks for reading!&lt;/p&gt; 
    </content:encoded>

    <pubDate>Sun, 06 Jan 2013 13:37:00 +0000</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20130106_65.html</guid>
    
</item>
<item>
    <title>Consistent hashing for PHP</title>
    <link>http://blog.dynom.nl/archives/Consistent-hashing-for-PHP_20121227_64.html</link>
            <category>PHP</category>
            <category>PlanetPHP</category>
    
    <comments>http://blog.dynom.nl/archives/Consistent-hashing-for-PHP_20121227_64.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=64</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.dynom.nl/rss.php?version=2.0&amp;type=comments&amp;cid=64</wfw:commentRss>
    

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;p&gt;Since almost a year or so, I&#039;ve been programming less and managing more.. Well that obviously begged for a side projected and voila, that is the story why I started this new project.&lt;/p&gt;&lt;p&gt;I&#039;ve always had an interest for distributed systems and once I learned about Consistent Hashing I was blown by the simplicity, yet it&#039;s massive impact and effectiveness. I can start a massive buzz-word galore at this point, but I much rather move over to my latest project, CANOMA.&lt;/p&gt;&lt;p&gt;&lt;b&gt;If you just want to see code, head on here:&lt;/b&gt;&amp;#160;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/github.com/Dynom/Canoma&#039;);&quot;  mce_href=&quot;https://github.com/Dynom/Canoma&quot; title=&quot;Cache node manager for PHP&quot; href=&quot;https://github.com/Dynom/Canoma&quot;&gt;github.com/Dynom/Canoma&lt;/a&gt;&lt;/p&gt;&lt;p&gt;CANOMA, short for Cache Node Manager, is a well tested PHP library that allows for very easy implementation of a distributed caching strategy. It supports various algorithms, ranging from fast and simple to complex and slow. I&#039;ve also included a tool to help you choose the best algorithm and settings for your infrastructure, since this is very dependent on the amount of caching nodes, the amount of expected cache keys and the amount of redundancy you want to have.&lt;/p&gt;&lt;h2&gt;Some code&amp;#160;&lt;/h2&gt; &lt;br /&gt;&lt;a href=&quot;http://blog.dynom.nl/archives/Consistent-hashing-for-PHP_20121227_64.html#extended&quot;&gt;Continue reading &quot;Consistent hashing for PHP&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Thu, 27 Dec 2012 11:37:00 +0000</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20121227_64.html</guid>
    
</item>
<item>
    <title>Logging best practices</title>
    <link>http://blog.dynom.nl/archives/Logging-best-practices_20120304_63.html</link>
            <category>PlanetPHP</category>
            <category>Software development</category>
    
    <comments>http://blog.dynom.nl/archives/Logging-best-practices_20120304_63.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=63</wfw:comment>

    <slash:comments>4</slash:comments>
    <wfw:commentRss>http://blog.dynom.nl/rss.php?version=2.0&amp;type=comments&amp;cid=63</wfw:commentRss>
    

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;h1&gt;Introduction&lt;/h1&gt;
&lt;p&gt;This document explains some best practices for application error/debug logging. Application logging is an important &quot;tool&quot; to help identifying problems. If done correctly, and if an infrastructure is in place that allows events to be put into context, it&#039;s easier to debug situations and thus makes it easier to solve problems sooner.&lt;/p&gt;
&lt;p&gt; While out of scope for this document, I&#039;d like to point out the following tools that can make that possible:
&lt;/p&gt;&lt;ul&gt;
&lt;li&gt; Logstash - &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/logstash.net&#039;);&quot;  mce_href=&quot;http://logstash.net&quot; href=&quot;http://logstash.net&quot;&gt;http://logstash.net&lt;/a&gt;&lt;/li&gt;
&lt;li&gt; Graylog2 - &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/graylog2.org&#039;);&quot;  mce_href=&quot;http://graylog2.org&quot; href=&quot;http://graylog2.org&quot;&gt;http://graylog2.org&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h1&gt; Different logging meanings&lt;/h1&gt;
&lt;p&gt;Logging can mean different things and logging can have different purposes. The logging this document refers to is application and semantic logging.&lt;/p&gt;
&lt;p&gt;Application logging (also called &quot;debug&quot; or &quot;error&quot; logging) is intended to keep track of the &quot;low level&quot; application behaviour. Application logging is used to log events, that allows for debugging a problem within an application or to monitor application health. In contrast, a different form of logging could for example be Google Analytics. Tracking (or &quot;logging&quot; actions of) visitors of a website, this type of logging is very different and not something this document refers too.&lt;/p&gt;

&lt;h1&gt;Why do we log&lt;/h1&gt;
&lt;p&gt;In order to understand how to log, it must first be clear what we try to accomplish with application logging.&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://blog.dynom.nl/archives/Logging-best-practices_20120304_63.html#extended&quot;&gt;Continue reading &quot;Logging best practices&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Sun, 04 Mar 2012 11:38:00 +0000</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20120304_63.html</guid>
    <category>graylog2</category>
<category>logging</category>
<category>logstash</category>
<category>php</category>
<category>planetphp</category>
<category>software development</category>

</item>
<item>
    <title>A world without cookies</title>
    <link>http://blog.dynom.nl/archives/A-world-without-cookies_20110627_62.html</link>
            <category>PlanetPHP</category>
    
    <comments>http://blog.dynom.nl/archives/A-world-without-cookies_20110627_62.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=62</wfw:comment>

    <slash:comments>8</slash:comments>
    <wfw:commentRss>http://blog.dynom.nl/rss.php?version=2.0&amp;type=comments&amp;cid=62</wfw:commentRss>
    

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;p&gt;Imagine a world wide web without cookies. And this might not be the strangest thing, since the use of cookies is severely limited since&amp;#160;Wednesday&amp;#160;the 22nd of June 2011 in the Netherlands. And more countries will follow:&amp;#160;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.bbc.co.uk/news/technology-12668552&#039;);&quot;  href=&quot;http://www.bbc.co.uk/news/technology-12668552&quot;&gt;http://www.bbc.co.uk/news/technology-12668552&lt;/a&gt;.&amp;#160;&lt;/p&gt;&lt;h2&gt;The Law&amp;#160;&lt;/h2&gt;&lt;p&gt;The (Dutch) law, that requires a user to agree before storing data, doesn&#039;t only apply on HTTP cookies. But in fact any kind of data that is stored on the users computer. Such as; HTML5 storage, flash cookies. But also desktop applications,&amp;#160;etc.. The law also states that cookies &quot;required&quot; for certain functionality, are allowed without confirmation. Personally I don&#039;t see how anything will change, with this exception in place. And I wonder how many experts were involved into making this law. But that is a subject for another article perhaps...&lt;/p&gt;&lt;h2&gt;What are cookies&lt;/h2&gt;&lt;p&gt;Cookies are little packages of information stored in the browser of a website visitor, they can contain &quot;small&quot; amounts of data such as an identifiable&amp;#160;token or a user preference.&lt;/p&gt;&lt;h2&gt;What purpose do cookies serve&lt;/h2&gt;&lt;p&gt;Cookies are very generic and can be used for many things, good and bad. The most popular probably being tracking your activity and advertisement. But they are also used to keep a state between requests and to store a preference. Such as &quot;remember me&quot; at a login form, or perhaps &quot;no I do not want to participate in your survey&quot;.&lt;/p&gt;&lt;h2&gt;Cookie problems&lt;/h2&gt;&lt;p&gt;&lt;strike&gt;If &lt;/strike&gt;When the law becomes international, you are potentially violating laws by simply calling something like: &lt;font class=&quot;Apple-style-span&quot; face=&quot;&#039;courier new&#039;, courier&quot;&gt;setcookie()&lt;/font&gt; without the users&amp;#160;consent. There are hacks around the typical HTTP cookies, by using flash cookies for example (Oh and btw, here a guide on how to clear those:&amp;#160;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager07.html&#039;);&quot;  mce_href=&quot;http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager07.html&quot; href=&quot;http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager07.html&quot;&gt;http://www.macromedia.com/...ngs_manager07.html&lt;/a&gt;). And possibly HTML5 storage could play a role here (or any of it&#039;s derivatives).&lt;/p&gt;&lt;p&gt;Another thing that has been happening, is visitor awareness and thus browser features. More and more people block cookies to stop advertisement tracking, but unfortunately this also prevents a user to use the features he or she wants to use (such as login sessions, etc.). There is an answer for this and quite a few browser vendor&#039;s plan on implementing the &quot;Do Not Track&quot; (&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/donottrack.us/&#039;);&quot;  href=&quot;http://donottrack.us/&quot;&gt;http://donottrack.us/&lt;/a&gt;)&amp;#160;feature, or have already done so. But I&#039;m not too happy with it. The downside of &quot;Do Not Track&quot; is that it&#039;s voluntary for website owners and advertisement companies to respect this feature.&amp;#160;Other tools include projects such as &quot;Ad Blocker&quot;, that only block cookies (and more) for advertisement purposes. It works pretty good, but that is hardly user-friendly.&lt;/p&gt;&lt;p&gt;But, back to &quot;no more cookies&quot;... How do you solve the problem of keeping a state between requests over a stateless protocol?&lt;/p&gt;&lt;h2&gt;Some ideas&amp;#160;&lt;/h2&gt;&lt;div style=&quot;background-color: rgb(255, 255, 255); &quot;&gt;&lt;p style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; &quot;&gt;Well in short, I have some ideas but definitely no real answers. I don&#039;t think there is a real answer just yet.&lt;/p&gt;&lt;p style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; &quot;&gt;Let&#039;s take the example of a login session. Where you want to offer a secure section to your visitors, where they can (e.g.) read their e-mail, privately.&amp;#160;A few things come to mind:&lt;/p&gt;&lt;p style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; &quot;&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Identifying yourself in every relevant request, using headers for example or an argument&amp;#160;&lt;font class=&quot;Apple-style-span&quot; face=&quot;&#039;courier new&#039;, courier&quot;&gt;&amp;amp;userId=42&lt;/font&gt;&amp;#160;in the request. This however has some big problems on its own.&lt;/li&gt;&lt;li&gt;Digest authentication on every relevant request.&lt;/li&gt;&lt;li&gt;Take a look at other technologies, such as IPv6 and move authentication to a lower level.&lt;/li&gt;&lt;li&gt;Perhaps use a commit and rollback system. Where you can do a variety of actions and only your password will be asked in the end, either applying or discarding your actions. Requiring you only to enter your login once. Not the most ideal solution for e-mail though, I have to admit. With this system you would re-post your data to next screens in a similar fashion as e.g. a wizard.&lt;/li&gt;&lt;li&gt;Or perhaps we need to move away from complete server-side applications and move to the client, Javascript applications and use the HTTP spec a little better as it was intended and only have web-services.&lt;/li&gt;&lt;/ol&gt;&lt;div style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; &quot;&gt;Many, if not all, of the things I mentioned above would require secure connections (SSL/TLS) to avoid other security problems. Which might not be a bad move anyway.&lt;/div&gt;&lt;div style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; &quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Personally I think that there is a future, in an improved implementation of digest authentication over SSL. One that uses HMAC and stronger&amp;#160;algorithms, SSL would then supply the missing server validation feature. It should also be more strict and not fall back to insecure legacy features.&lt;/div&gt;&lt;div style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; &quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2&gt;Conclusion&lt;/h2&gt;&lt;div&gt;All in all I firmly&amp;#160;believe&amp;#160;that the browser should play a big role in this new cookie recipe and should (partially) solve these problems. Also there should be a more clear separation between &quot;generic storage&quot; and authentication versus a simulated&amp;#160;persistency. In more perfect world I would vote for a solution that works on other (underlying)&amp;#160;layers and make it application agnostic.&lt;/div&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;div&gt;I suppose the point I&#039;m trying to make with this article is the following:&amp;#160;Take away a feature the entire world uses (since 1996), and wait for the brilliant and creative minds, perhaps such as yourself, to come up with a more innovative feature. It&#039;s time for something better!&lt;/div&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; background-color: rgb(255, 255, 255); &quot;&gt;&lt;p&gt;Another interesting read:&lt;/p&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.vsecurity.com/download/papers/WeaningTheWebOffOfSessionCookies.pdf&#039;);&quot;  href=&quot;http://www.vsecurity.com/download/papers/WeaningTheWebOffOfSessionCookies.pdf&quot;&gt;http://www.vsecurity.com/download/papers/WeaningTheWebOffOfSessionCookies.pdf&lt;/a&gt;&amp;#160;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;/div&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;b&gt;I made some updates to this article, based on some comments.&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;/div&gt; 
    </content:encoded>

    <pubDate>Mon, 27 Jun 2011 20:00:00 +0000</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20110627_62.html</guid>
    
</item>
<item>
    <title>PHP Quiz part 4</title>
    <link>http://blog.dynom.nl/archives/PHP-Quiz-part-4_20101102_51.html</link>
            <category>PHP</category>
            <category>PHPQuiz</category>
            <category>PlanetPHP</category>
    
    <comments>http://blog.dynom.nl/archives/PHP-Quiz-part-4_20101102_51.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=51</wfw:comment>

    <slash:comments>5</slash:comments>
    <wfw:commentRss>http://blog.dynom.nl/rss.php?version=2.0&amp;type=comments&amp;cid=51</wfw:commentRss>
    

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;p&gt;It has been a while, but here is part 4 of the PHP Quiz series! A few questions to crack your brain about, or perhaps you know them all? Try them and find out! Also do read the idea behind these quizzes, here: &lt;a href=&quot;http://blog.dynom.nl/archives/The-PHP-Quiz-series_20090925_46.html&quot; title=&quot;The PHP Quiz series - background information&quot; target=&quot;_blank&quot; mce_href=&quot;/archives/The-PHP-Quiz-series_20090925_46.html&quot;&gt;The PHP Quiz series&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;As always, think of the answer before you execute the code or look it up. &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/codepad.org/&#039;);&quot;  href=&quot;http://codepad.org/&quot; mce_href=&quot;http://codepad.org/&quot;&gt;Codepad&lt;/a&gt; might help you run the examples. You can find round three &lt;a href=&quot;http://blog.dynom.nl/archives/PHP-Quiz-part-3_20090921_37.html&quot; mce_href=&quot;http://blog.dynom.nl/archives/PHP-Quiz-part-3_20090921_37.html&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;h2&gt;Visibility is key&lt;/h2&gt;&lt;p&gt;Now you see me, now you don&#039;t&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; testClass &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;$fubar&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;rabuf&quot;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; test&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$test&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/var_dump&#039;);&quot;  href=&quot;http://www.php.net/var_dump&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;var_dump&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$test&lt;/span&gt;-&amp;gt;fubar&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; dummy &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; test&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$test&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/var_dump&#039;);&quot;  href=&quot;http://www.php.net/var_dump&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;var_dump&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$test&lt;/span&gt;-&amp;gt;fubar&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$object1&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; testClass;&lt;br /&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$object2&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; testClass;&lt;br /&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$dummy&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; dummy;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$object1&lt;/span&gt;-&amp;gt;test&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$object1&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Can $object1 see the private property of object1 ?&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$object1&lt;/span&gt;-&amp;gt;test&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$object2&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Can $object1 see the private property of object2 ?&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$dummy&lt;/span&gt;-&amp;gt;test&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$object1&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Can $dummy see the private property of object1 ?&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;h2&gt;Static, sticky, icky&lt;/h2&gt;&lt;p&gt;&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; test &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;$counter&lt;/span&gt; = -&lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; increment&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/static&#039;);&quot;  href=&quot;http://www.php.net/static&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;static&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;$cnt&lt;/span&gt; = &lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000&quot;&gt;$this&lt;/span&gt;-&amp;gt;counter = ++&lt;span style=&quot;color: #ff0000&quot;&gt;$cnt&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;$this&lt;/span&gt;;&lt;br /&gt;&amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$object1&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; test;&lt;br /&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$object1&lt;/span&gt;-&amp;gt;increment&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;-&amp;gt;increment&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$object2&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; test;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// What will the output be&lt;/span&gt;&lt;br /&gt;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/echo&#039;);&quot;  href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;$object2&lt;/span&gt;-&amp;gt;increment&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;-&amp;gt;counter;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;h2&gt;Getting the class&lt;/h2&gt;&lt;p&gt;&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; b &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; getClassA&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/echo&#039;);&quot;  href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/get_class&#039;);&quot;  href=&quot;http://www.php.net/get_class&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;get_class&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; getClassB&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/echo&#039;);&quot;  href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/get_class&#039;);&quot;  href=&quot;http://www.php.net/get_class&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;get_class&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; getClassC&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/echo&#039;);&quot;  href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;__CLASS__&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; a &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;extends&lt;/span&gt; b &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$a&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; a; &lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// What will be returned, &#039;a&#039; or &#039;b&#039; ?&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$a&lt;/span&gt;-&amp;gt;getClassA&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$a&lt;/span&gt;-&amp;gt;getClassB&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$a&lt;/span&gt;-&amp;gt;getClassC&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;h2&gt;The strptime function&lt;/h2&gt;&lt;p&gt;&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$result&lt;/span&gt; = strptime&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;2010-11-28&#039;&lt;/span&gt;, &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;%Y-%m-%d&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// What is the output?&lt;/span&gt;&lt;br /&gt;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/echo&#039;);&quot;  href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;$result&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;tm_mday&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; .&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;-&#039;&lt;/span&gt;. &lt;span style=&quot;color: #ff0000&quot;&gt;$result&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;tm_mon&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; .&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;-&#039;&lt;/span&gt;. &lt;span style=&quot;color: #ff0000&quot;&gt;$result&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;tm_year&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;;&lt;br /&gt;&amp;#160;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;h2&gt;The oldtimer&lt;/h2&gt;&lt;p&gt;&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;for&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$i&lt;/span&gt; = &lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #ff0000&quot;&gt;$loop&lt;/span&gt; = &lt;span style=&quot;color: #cc66cc;&quot;&gt;10&lt;/span&gt;, &lt;span style=&quot;color: #ff0000&quot;&gt;$a&lt;/span&gt; = &lt;span style=&quot;color: #cc66cc;&quot;&gt;10&lt;/span&gt;; &lt;span style=&quot;color: #ff0000&quot;&gt;$i&lt;/span&gt; &amp;lt; &lt;span style=&quot;color: #ff0000&quot;&gt;$loop&lt;/span&gt;; ++&lt;span style=&quot;color: #ff0000&quot;&gt;$i&lt;/span&gt;, &lt;span style=&quot;color: #ff0000&quot;&gt;$a&lt;/span&gt; = &lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; ++&lt;span style=&quot;color: #ff0000&quot;&gt;$a&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// What is the output ?&lt;/span&gt;&lt;br /&gt;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/echo&#039;);&quot;  href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;$a&lt;/span&gt;;&lt;/div&gt;&lt;/p&gt; 
    </content:encoded>

    <pubDate>Tue, 02 Nov 2010 08:18:00 +0000</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20101102_51.html</guid>
    <category>php</category>
<category>php quiz</category>
<category>phpquiz</category>
<category>planetphp</category>
<category>static</category>
<category>visibility</category>

</item>
<item>
    <title>What do you get when you mix; MSSQL, PDO and uniqueidentifier?</title>
    <link>http://blog.dynom.nl/archives/What-do-you-get-when-you-mix;-MSSQL,-PDO-and-uniqueidentifier_20100608_57.html</link>
            <category>PHP</category>
            <category>PlanetPHP</category>
    
    <comments>http://blog.dynom.nl/archives/What-do-you-get-when-you-mix;-MSSQL,-PDO-and-uniqueidentifier_20100608_57.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=57</wfw:comment>

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

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;p&gt;You get NULL!&lt;/p&gt;&lt;p&gt;Well you get NULL when you don&#039;t cast. Say for example you do the following:&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$dbh&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; PDO&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;..&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$stmt&lt;/span&gt; = &lt;span style=&quot;color: #ff0000&quot;&gt;$dbh&lt;/span&gt;-&amp;gt;prepare&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;SELECT accountid FROM dbo.Account&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$stmt&lt;/span&gt;-&amp;gt;execute&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/echo&#039;);&quot;  href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;$stmt&lt;/span&gt;-&amp;gt;fetchColumn&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// NULL&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;
&lt;/p&gt;&lt;p&gt;But when you do the following:&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$stmt&lt;/span&gt; = &lt;span style=&quot;color: #ff0000&quot;&gt;$dbh&lt;/span&gt;-&amp;gt;prepare&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;SELECT CAST(accountid AS varchar(36)) accountid FROM dbo.Account&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$stmt&lt;/span&gt;-&amp;gt;execute&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/echo&#039;);&quot;  href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;$stmt&lt;/span&gt;-&amp;gt;fetchColumn&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// &amp;quot;F05C92A1-3119-4206-A123-49A759AC99FB&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;I didn&#039;t think the casting would be necessary, since according to the manual: &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/msdn.microsoft.com/en-us/library/aa226054%28SQL.80%29.aspx&#039;);&quot;  href=&quot;http://msdn.microsoft.com/en-us/library/aa226054%28SQL.80%29.aspx&quot; mce_href=&quot;http://msdn.microsoft.com/en-us/library/aa226054%28SQL.80%29.aspx&quot;&gt;http://msdn.microsoft.com/en-us/library/aa226054(SQL.80).aspx&lt;/a&gt; the datatype &#039;uniqueidentifier&#039; has implicit casts with multiple data-types. But I guess it&#039;s just one of those things...&lt;br /&gt;&lt;/p&gt; 
    </content:encoded>

    <pubDate>Tue, 08 Jun 2010 19:58:00 +0000</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20100608_57.html</guid>
    <category>cast</category>
<category>mssql</category>
<category>pdo</category>
<category>php</category>
<category>planetphp</category>
<category>uniqueidentifier</category>

</item>
<item>
    <title>Connecting from PHP on a non Microsoft OS to MSSQL with a domain account</title>
    <link>http://blog.dynom.nl/archives/Connecting-from-PHP-on-a-non-Microsoft-OS-to-MSSQL-with-a-domain-account_20100604_56.html</link>
            <category>PHP</category>
            <category>PlanetPHP</category>
    
    <comments>http://blog.dynom.nl/archives/Connecting-from-PHP-on-a-non-Microsoft-OS-to-MSSQL-with-a-domain-account_20100604_56.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=56</wfw:comment>

    <slash:comments>3</slash:comments>
    <wfw:commentRss>http://blog.dynom.nl/rss.php?version=2.0&amp;type=comments&amp;cid=56</wfw:commentRss>
    

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;div&gt;I was asked to create a web interface front-end with Microsoft Dynamics CRM as back-end. But I had some troubles setting up the connection, since it has to be done using a domain logon. This doesn&#039;t have to be a problem at all, unless your configuration is wrong! In this article I&#039;ll explain a few things and point you in the right direction when you have login problems.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As stated earlier, the server running the PHP installation is not Microsoft. In this case a AS400 installation, but it could&#039;ve been a Linux installation also. I&#039;m using PDO for this article and PHP version 5.2.11. Even if you don&#039;t want to use PDO, I recommend using it only for debugging (if possible) since that will give you *most likely* more debug information then the mssql_* family. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When using PDO with a MS-SQL database, you&#039;ll need to supply &quot;dblib&quot; as driver and DBLib uses FreeTDS as underlaying library. FreeTDS can be a source of troubles when you&#039;re trying to connect, if not configured properly. So I&#039;ll kick-off with a little information about it. Don&#039;t skip it if you have login problems!&lt;/div&gt; &lt;br /&gt;&lt;a href=&quot;http://blog.dynom.nl/archives/Connecting-from-PHP-on-a-non-Microsoft-OS-to-MSSQL-with-a-domain-account_20100604_56.html#extended&quot;&gt;Continue reading &quot;Connecting from PHP on a non Microsoft OS to MSSQL with a domain account&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Fri, 04 Jun 2010 05:24:00 +0000</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20100604_56.html</guid>
    <category>active directory</category>
<category>freetds</category>
<category>mssql</category>
<category>pdo</category>
<category>php</category>
<category>planetphp</category>
<category>sspi</category>

</item>
<item>
    <title>PHPUnit conditional test based on a PHP version</title>
    <link>http://blog.dynom.nl/archives/PHPUnit-conditional-test-based-on-a-PHP-version_20100419_55.html</link>
            <category>PHP</category>
            <category>PlanetPHP</category>
    
    <comments>http://blog.dynom.nl/archives/PHPUnit-conditional-test-based-on-a-PHP-version_20100419_55.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=55</wfw:comment>

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

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;p&gt;I had a problem with running test cases on multiple CI environments, where one of the two runs on PHP 5.2 and the other on PHP 5.3. This basically meant that all our pretty PHP 5.3 code caused the builds to fail on the 5.2 only machine. To solve this problem I needed a way to skip tests when the PHP version was less then 5.3.0. Besides the reason I needed this for a -less then ideal- setup. This can also be a generic way to skip certain tests, based on a PHP version. &lt;/p&gt;&lt;p&gt;&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; someTest &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;extends&lt;/span&gt; PHPUnit_Framework_TestCase&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; setUp&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Testing if we are dealing with version 5.3.0 or higher&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;!&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/version_compare&#039;);&quot;  href=&quot;http://www.php.net/version_compare&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;version_compare&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;PHP_VERSION&lt;/span&gt;, &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;5.3.0&#039;&lt;/span&gt;, &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;&amp;gt;=&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000&quot;&gt;$this&lt;/span&gt;-&amp;gt;markTestSkipped&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;Invalid PHP version, unable to run tests.&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; test_testFoo&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// .. some awesum test case .. \\&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;You can also use the cool &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.phpunit.de/manual/3.4/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.examples.StackTest2.php&#039;);&quot;  href=&quot;http://www.phpunit.de/manual/3.4/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.examples.StackTest2.php&quot; title=&quot;@annotation example&quot; mce_href=&quot;http://www.phpunit.de/manual/3.4/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.examples.StackTest2.php&quot;&gt;@depends&lt;/a&gt; annotation of &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.phpunit.de&#039;);&quot;  href=&quot;http://www.phpunit.de&quot; title=&quot;PHPUnit website&quot; mce_href=&quot;http://www.phpunit.de&quot;&gt;PHPUnit&lt;/a&gt; and put the version logic in a test. This has my preference, but it&#039;s not always possible. In case you have some code that simply can&#039;t be parsed by the older PHP engines.&lt;/p&gt;&lt;p&gt;If you know a better way to do this, please share! &lt;br /&gt;&lt;/p&gt; 
    </content:encoded>

    <pubDate>Mon, 19 Apr 2010 14:47:00 +0000</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20100419_55.html</guid>
    
</item>
<item>
    <title>Multiple PHP versions on one webserver</title>
    <link>http://blog.dynom.nl/archives/Multiple-PHP-versions-on-one-webserver_20091103_53.html</link>
            <category>Apache</category>
            <category>PHP</category>
            <category>PlanetPHP</category>
    
    <comments>http://blog.dynom.nl/archives/Multiple-PHP-versions-on-one-webserver_20091103_53.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=53</wfw:comment>

    <slash:comments>7</slash:comments>
    <wfw:commentRss>http://blog.dynom.nl/rss.php?version=2.0&amp;type=comments&amp;cid=53</wfw:commentRss>
    

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;h2&gt;Introduction&lt;/h2&gt;&lt;p&gt;This is a blog about running two PHP versions on one webserver and using multiple php.ini files, this combination can be a tricky one to tackle. But luckily one we can tackle quite easily as long as one of the PHP versions is &amp;gt;= 5.2.7. For this example I&#039;ll be using Apache, but the webserver flavor doesn&#039;t really matter. The most important part is the &quot;PHP_INI_SCAN_DIR&quot; environment variable. &lt;/p&gt;&lt;h2&gt;The why&lt;/h2&gt;&lt;p&gt;There could be a number of reasons to want what I&#039;m about to talk about. In my case I have a project where I have a legacy code-base, running on a specific PHP version, and a new code-base which will be run on 5.3. Because the new code-base will be a ongoing progress of replacing the old, it first has to run side by side with the legacy code-base. So I wanted my development image to run two PHP versions.&lt;/p&gt;&lt;p&gt;The old code-base used php.ini settings such as a include-path, error reporting, etc.&amp;#160; Which will be different from the new code-bas, and those can no-longer be set with the &#039;php_value&#039; feature of Apaches since the PHP version we&#039;ll be using for that runs as (f)CGI rather then as module.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://blog.dynom.nl/archives/Multiple-PHP-versions-on-one-webserver_20091103_53.html#extended&quot;&gt;Continue reading &quot;Multiple PHP versions on one webserver&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Tue, 03 Nov 2009 07:39:00 +0000</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20091103_53.html</guid>
    <category>apache</category>
<category>environment variable</category>
<category>multiple versions</category>
<category>php</category>
<category>planetphp</category>

</item>
<item>
    <title>Multiple backend session storage handler</title>
    <link>http://blog.dynom.nl/archives/Multiple-backend-session-storage-handler_20091011_50.html</link>
            <category>PHP</category>
    
    <comments>http://blog.dynom.nl/archives/Multiple-backend-session-storage-handler_20091011_50.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=50</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.dynom.nl/rss.php?version=2.0&amp;type=comments&amp;cid=50</wfw:commentRss>
    

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;p&gt;Recently I got asked if I knew about a system that supports multiple session back-ends at once. I didn&#039;t know about one and since it&#039;s not rocket-science I decided to spent a few hours and whoop something up. &lt;/p&gt;&lt;p&gt;For the impatient, checkout: &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/github.com/Dynom/SessionHandler&#039;);&quot;  href=&quot;http://github.com/Dynom/SessionHandler&quot; title=&quot;The Session Handler lib on github.com&quot; mce_href=&quot;http://github.com/Dynom/SessionHandler&quot;&gt;http://github.com/Dynom/SessionHandler&lt;/a&gt;&lt;/p&gt;&lt;h2&gt;What does it do?&lt;/h2&gt;&lt;p&gt;It is a drop-in high-availability storage back-end for PHP sessions by offering a redundant session storage system. It&#039;s as easy as including the lib, define the drivers you want to use (e.g. Memcache and MySQL) prepare their configuration/installation and done. If you already have a MySQL server and a Memcache instance running you can set it up in about 5 minutes. It&#039;s also easy to extend and write new drivers, just extend the template class and fill in the blanks.&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://blog.dynom.nl/archives/Multiple-backend-session-storage-handler_20091011_50.html#extended&quot;&gt;Continue reading &quot;Multiple backend session storage handler&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Sun, 11 Oct 2009 09:17:00 +0000</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20091011_50.html</guid>
    <category>backend</category>
<category>driver</category>
<category>loadbalancing</category>
<category>php</category>
<category>session handler</category>
<category>session_set_save_handler</category>
<category>state</category>
<category>write trough</category>

</item>
<item>
    <title>The PHP Quiz series</title>
    <link>http://blog.dynom.nl/archives/The-PHP-Quiz-series_20090925_46.html</link>
            <category>PHPQuiz</category>
    
    <comments>http://blog.dynom.nl/archives/The-PHP-Quiz-series_20090925_46.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=46</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.dynom.nl/rss.php?version=2.0&amp;type=comments&amp;cid=46</wfw:commentRss>
    

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;p&gt;I like solving puzzles, probably one of the reason why I like programming as much as I do. I also like finding challenges and experimenting, as such I came to the idea to start the &lt;a href=&quot;http://blog.dynom.nl/categories/PHPQuiz_12&quot; title=&quot;PHP Quizzes&quot; mce_href=&quot;/categories/PHPQuiz_12&quot;&gt;PHP Quiz series&lt;/a&gt;. They contain typical combination of PHP quirks and lesser known features of PHP.&lt;/p&gt;&lt;p&gt;The reason behind the quizzes is not to advocate bad or good coding practices, but it&#039;s intended to let you find out &lt;i&gt;the why&lt;/i&gt; in all of it. I believe that by understanding what happens it can make you a better programmer and you might spot bugs easier then without knowing what happens. &lt;/p&gt;&lt;p&gt;The series are not ordered in level of difficulty but merely in the order that I found out about them,  thought about them or where simply sent in. But in general I think it&#039;s safe to say that your knowledge of PHP should be quite a leap forward from novice before you can answer most questions. This however doesn&#039;t mean that, once you can do the quizzes flawlessly, that you are a superior programmer. There is a big different between knowing how to design an application and knowing why &lt;i&gt;$array = array(1,1) + array(2,2)&lt;/i&gt; only results in an array with two elements.&lt;/p&gt;&lt;p&gt;An overview of all the PHP Quizzes: &lt;a href=&quot;http://blog.dynom.nl/categories/PHPQuiz_12&quot; mce_href=&quot;/categories/PHPQuiz_12&quot;&gt;http://blog.dynom.nl/categories/PHPQuiz_12&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;A special thanks to the people who sent in  code samples, happy quizzing!&lt;/p&gt;&lt;p&gt;-D&lt;/p&gt; 
    </content:encoded>

    <pubDate>Fri, 25 Sep 2009 05:23:00 +0000</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20090925_46.html</guid>
    <category>php quiz</category>
<category>phpquiz</category>

</item>
<item>
    <title>PHP Quiz part 3</title>
    <link>http://blog.dynom.nl/archives/PHP-Quiz-part-3_20090921_37.html</link>
            <category>PHP</category>
            <category>PHPQuiz</category>
            <category>PlanetPHP</category>
    
    <comments>http://blog.dynom.nl/archives/PHP-Quiz-part-3_20090921_37.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=37</wfw:comment>

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

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;p&gt;Welcome to another part of the PHP Quiz series, again some interesting questions to crack your brain about. If you have some nice additions or questions, be sure to leave a comment. Enjoy part three!&lt;/p&gt;&lt;p&gt;As always, think of the answer before you execute the code or look it up. You can find round two &lt;a href=&quot;http://blog.dynom.nl/archives/PHP-Quiz-part-2_20090514_27.html&quot; mce_href=&quot;http://blog.dynom.nl/archives/PHP-Quiz-part-2_20090514_27.html&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;h3&gt;Unset cast&lt;/h3&gt;&lt;p&gt;What is the type of $a and what is the type of $b&lt;br /&gt;&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$a&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;A&quot;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$b&lt;/span&gt; = &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/unset&#039;);&quot;  href=&quot;http://www.php.net/unset&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;unset&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;$a&lt;/span&gt;;&lt;br /&gt;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/var_dump&#039;);&quot;  href=&quot;http://www.php.net/var_dump&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;var_dump&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$a&lt;/span&gt;, &lt;span style=&quot;color: #ff0000&quot;&gt;$b&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160;&lt;/div&gt;
&lt;/p&gt;&lt;h3&gt;Form fun&lt;/h3&gt;&lt;p&gt;What will the output be?&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&amp;lt;form method=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;post&quot;&lt;/span&gt; action=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;&quot;&lt;/span&gt; enctype=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;text/plain&quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;lt;input name=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;search&quot;&lt;/span&gt; type=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;text&quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;lt;input type=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;submit&quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/error_reporting&#039;);&quot;  href=&quot;http://www.php.net/error_reporting&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;error_reporting&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;E_ALL&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/echo&#039;);&quot;  href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;string&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; filter_input&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;INPUT_POST, &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;search&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;?&amp;gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;
&lt;/p&gt;&lt;h3&gt;Fun with strings&lt;/h3&gt;&lt;p&gt;Strings in PHP are versatile, but how versatile are they... What will the output be?&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$juggling&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Itffkhmf&quot;&lt;/span&gt;; &lt;br /&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$rox&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Spy&quot;&lt;/span&gt;; &lt;br /&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$b&lt;/span&gt; = &lt;span style=&quot;color: #ff0000&quot;&gt;$c&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;&quot;&lt;/span&gt;; &lt;br /&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;for&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$i&lt;/span&gt;=&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;; &lt;span style=&quot;color: #ff0000&quot;&gt;$i&lt;/span&gt;&amp;lt;strlen&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$juggling&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;span style=&quot;color: #ff0000&quot;&gt;$i&lt;/span&gt;++&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt; &lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000&quot;&gt;$b&lt;/span&gt; .= &lt;span style=&quot;color: #ff0000&quot;&gt;$juggling&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;$i&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;; &lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000&quot;&gt;$b&lt;/span&gt;++;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;for&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$i&lt;/span&gt;=&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;; &lt;span style=&quot;color: #ff0000&quot;&gt;$i&lt;/span&gt;&amp;lt;strlen&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$rox&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;span style=&quot;color: #ff0000&quot;&gt;$i&lt;/span&gt;++&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt; &lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000&quot;&gt;$c&lt;/span&gt; .= &lt;span style=&quot;color: #ff0000&quot;&gt;$rox&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;$i&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;; &lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000&quot;&gt;$c&lt;/span&gt;--; &lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/var_dump&#039;);&quot;  href=&quot;http://www.php.net/var_dump&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;var_dump&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;$b&lt;/span&gt;, &lt;span style=&quot;color: #ff0000&quot;&gt;$c&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://blog.dynom.nl/archives/PHP-Quiz-part-3_20090921_37.html#extended&quot;&gt;Continue reading &quot;PHP Quiz part 3&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Mon, 21 Sep 2009 15:35:00 +0000</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20090921_37.html</guid>
    <category>form</category>
<category>php</category>
<category>php quiz</category>
<category>phpquiz</category>
<category>planetphp</category>
<category>precedence</category>
<category>references</category>
<category>string</category>
<category>unset cast</category>

</item>
<item>
    <title>Did you know... part two</title>
    <link>http://blog.dynom.nl/archives/Did-you-know...-part-two_20090625_32.html</link>
            <category>PHP</category>
            <category>PlanetPHP</category>
    
    <comments>http://blog.dynom.nl/archives/Did-you-know...-part-two_20090625_32.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=32</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.dynom.nl/rss.php?version=2.0&amp;type=comments&amp;cid=32</wfw:commentRss>
    

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;p&gt;In these blog series I&#039;d like to talk a bit about some &quot;Did you knows&quot;. These series contain information I came across along the way and I mention them here to give you insight or just to make you aware of it&#039;s existence. The information is by no means in chronological order and mostly not even covering &quot;state of the art&quot; or &quot;brand new&quot; items for that matter. Some are directly code related, others are just brief descriptions. Basically it&#039;s just a pile of PHP and web related information. You can find part one &lt;a href=&quot;http://blog.dynom.nl/archives/Did-you-know...-part-one_20081111_31.html&quot; title=&quot;Did you know... part one&quot; mce_href=&quot;/archives/Did-you-know...-part-one_20081111_31.html&quot;&gt;here&lt;/a&gt;.&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://blog.dynom.nl/archives/Did-you-know...-part-two_20090625_32.html#extended&quot;&gt;Continue reading &quot;Did you know... part two&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Thu, 25 Jun 2009 17:14:00 +0000</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20090625_32.html</guid>
    <category>did you know</category>
<category>max</category>
<category>min</category>
<category>php</category>
<category>planetphp</category>
<category>references</category>
<category>sscanf</category>
<category>strtok</category>

</item>
<item>
    <title>PHP Quiz part 2</title>
    <link>http://blog.dynom.nl/archives/PHP-Quiz-part-2_20090514_27.html</link>
            <category>PHP</category>
            <category>PHPQuiz</category>
            <category>PlanetPHP</category>
    
    <comments>http://blog.dynom.nl/archives/PHP-Quiz-part-2_20090514_27.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=27</wfw:comment>

    <slash:comments>13</slash:comments>
    <wfw:commentRss>http://blog.dynom.nl/rss.php?version=2.0&amp;type=comments&amp;cid=27</wfw:commentRss>
    

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;p&gt;A short quiz this time, but that doesn&#039;t make it less fun. Do you know the answer to all of them? Get a cup of coffee and kill 10 minutes with round two...&lt;/p&gt;
&lt;p&gt;As always, think of the answer before you execute the code or look it up. You can find round one &lt;a href=&quot;http://blog.dynom.nl/archives/PHP-Quiz-part-1_20080424_23.html&quot; mce_href=&quot;http://blog.dynom.nl/archives/PHP-Quiz-part-1_20080424_23.html&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;Array pointer&lt;/h3&gt;&lt;p&gt;What will the output be ? &lt;br /&gt;&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$array&lt;/span&gt; = &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/range&#039;);&quot;  href=&quot;http://www.php.net/range&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;range&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #cc66cc;&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/next&#039;);&quot;  href=&quot;http://www.php.net/next&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;next&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$array&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;foreach&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$array&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;as&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;$v&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/echo&#039;);&quot;  href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;$v&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;&lt;/p&gt;
&lt;h3&gt;ArrayAccess and isset fun &lt;/h3&gt;&lt;p&gt;isset or not isset, thats the question.&lt;br /&gt; &lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$a&lt;/span&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; ArrayObject;&lt;br /&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$a&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;fubar&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;NULL&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$null&lt;/span&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;= &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;NULL&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/isset&#039;);&quot;  href=&quot;http://www.php.net/isset&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;isset&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$null&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/echo&#039;);&quot;  href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/echo&#039;);&quot;  href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;2&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/isset&#039;);&quot;  href=&quot;http://www.php.net/isset&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;isset&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$a&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;fubar&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/echo&#039;);&quot;  href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/echo&#039;);&quot;  href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;2&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/array_key_exists&#039;);&quot;  href=&quot;http://www.php.net/array_key_exists&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array_key_exists&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;fubar&#039;&lt;/span&gt;, &lt;span style=&quot;color: #ff0000&quot;&gt;$a&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/echo&#039;);&quot;  href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/echo&#039;);&quot;  href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;2&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;&lt;/p&gt;
&lt;h3&gt;Typo?&lt;/h3&gt;&lt;p&gt;The output might be confusing.. &lt;br /&gt;&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/array&#039;);&quot;  href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;4&lt;/span&gt;&amp;gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;a&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/p&gt;
&lt;h3&gt;References&lt;/h3&gt;&lt;p&gt;How many notices will be thrown? &lt;br /&gt;&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt; &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/error_reporting&#039;);&quot;  href=&quot;http://www.php.net/error_reporting&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;error_reporting&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;E_ALL&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; a&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; &amp;amp; &lt;span style=&quot;color: #ff0000&quot;&gt;$array&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; b&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$array&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;a&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$array&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;br /&gt;b&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;$array&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&amp;#160;&lt;/div&gt;&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://blog.dynom.nl/archives/PHP-Quiz-part-2_20090514_27.html#extended&quot;&gt;Continue reading &quot;PHP Quiz part 2&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Thu, 14 May 2009 08:41:00 +0000</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20090514_27.html</guid>
    <category>arrayaccess</category>
<category>nesting structures</category>
<category>operator precedence</category>
<category>php</category>
<category>php quiz</category>
<category>phpquiz</category>
<category>planetphp</category>
<category>references</category>

</item>
<item>
    <title>Zend framework reminders</title>
    <link>http://blog.dynom.nl/archives/Zend-framework-reminders_20090415_33.html</link>
            <category>PHP</category>
    
    <comments>http://blog.dynom.nl/archives/Zend-framework-reminders_20090415_33.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=33</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.dynom.nl/rss.php?version=2.0&amp;type=comments&amp;cid=33</wfw:commentRss>
    

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;p&gt;Here a few of those &quot;how did that work again&quot; things, in Zend framework. Mostly for myself but hey, I&#039;m not greedy. If you know some new/nifty ones, feel free to leave a comment!&lt;/p&gt;&lt;h2&gt;Loading a view from a different directory&lt;/h2&gt;&lt;p&gt;&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; someAction&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Option one&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000&quot;&gt;$titleView&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; Zend_View&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000&quot;&gt;$titleView&lt;/span&gt;-&amp;gt;setScriptPath&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; APPLICATION_PATH .&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;views/scripts/&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Option two&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000&quot;&gt;$titleView&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; Zend_View&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/array&#039;);&quot;  href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;scriptPath&#039;&lt;/span&gt;=&amp;gt;APPLICATION_PATH .&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;views/scripts/&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000&quot;&gt;$viewResult&lt;/span&gt; = &lt;span style=&quot;color: #ff0000&quot;&gt;$titleView&lt;/span&gt;-&amp;gt;render&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;_my_view_script.phtml&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://blog.dynom.nl/archives/Zend-framework-reminders_20090415_33.html#extended&quot;&gt;Continue reading &quot;Zend framework reminders&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Wed, 15 Apr 2009 13:00:00 +0000</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20090415_33.html</guid>
    <category>php</category>
<category>zend framework</category>

</item>

</channel>
</rss>