<?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</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>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>2</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 12:38:00 +0100</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 22:00:00 +0200</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 09:18:00 +0100</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>Forms, buttons and prototypeJS's getInputs()</title>
    <link>http://blog.dynom.nl/archives/Forms,-buttons-and-prototypeJSs-getInputs_20101019_60.html</link>
            <category>Javascript</category>
    
    <comments>http://blog.dynom.nl/archives/Forms,-buttons-and-prototypeJSs-getInputs_20101019_60.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=60</wfw:comment>

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

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;p&gt;In forms you use input elements to send your form. But you can also use &quot;button&quot; elements to achieve the same goal. Quite recently someone committed changes into a framework I use often and changed the &quot;input&quot; elements to &quot;button&quot; elements. Normally this is no problem, but in this case it broke some Javascript I had going on. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;I used to use the following:&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;javascript&quot; style=&quot;text-align: left&quot;&gt;$&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;myForm&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;getInputs&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;submit&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;each&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;button&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: #009900; font-style: italic;&quot;&gt;// .. &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&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;But with this function you don&#039;t get any &quot;button&quot; elements, to solve this situation I changed it to:&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;javascript&quot; style=&quot;text-align: left&quot;&gt;$&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;myForm&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;select&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;button&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;input[type=submit]&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;each&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;button&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: #009900; font-style: italic;&quot;&gt;// .. &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&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;It works fine however simply filtering on &#039;button&#039; might be too greedy and some tweaking might be required. I use this to to track down which button was pressed by the user and act accordingly (e.g. &quot;Save and close&quot; versus &quot;save&quot;). &lt;br /&gt;&lt;/p&gt; 
    </content:encoded>

    <pubDate>Tue, 19 Oct 2010 12:36:00 +0200</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20101019_60.html</guid>
    <category>buttons</category>
<category>form</category>
<category>javascript</category>
<category>prototypejs</category>

</item>
<item>
    <title>Drop empty columns with dynamically defined columns and tables</title>
    <link>http://blog.dynom.nl/archives/Drop-empty-columns-with-dynamically-defined-columns-and-tables_20100817_58.html</link>
            <category>MySQL</category>
    
    <comments>http://blog.dynom.nl/archives/Drop-empty-columns-with-dynamically-defined-columns-and-tables_20100817_58.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=58</wfw:comment>

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

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;p&gt;For a migration process I wanted to build in extra validation in some destructive MySQL queries, to eliminate the risk that data might be lost. Of course all data is back-upped, but I rather be safe then sorry. &lt;/p&gt;&lt;p&gt;This is fairly straight forward, create a stored procedure and perform an ALTER statement whenever the previously defined criteria have been met. But I wanted to define a single procedure rather then create one for every table I had to drop columns from. And since you can&#039;t simply use variables for column/table names, you have to improvise a little. I came up with the following:&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;sql&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;-- Defining the &amp;quot;drop empty column&amp;quot; SP&lt;/span&gt;&lt;br /&gt;DELIMITER @@&lt;br /&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;DROP&lt;/span&gt; PROCEDURE &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;IF&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;EXISTS&lt;/span&gt; drop_empty_column @@&lt;br /&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;CREATE&lt;/span&gt; PROCEDURE drop_empty_column&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;IN&lt;/span&gt; itable VARCHAR&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;50&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: #993333; font-weight: bold;&quot;&gt;IN&lt;/span&gt; icolumn VARCHAR&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;50&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; OUT succeeded INT&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;BEGIN&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;SET&lt;/span&gt; @amount = -&lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;SET&lt;/span&gt; @itable = itable;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;SET&lt;/span&gt; @icolumn = icolumn;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;-- Build the query, with dynamic table and column. Store the result in @amount&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;SELECT&lt;/span&gt; CONCAT&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;SELECT COUNT(&#039;&lt;/span&gt;, @icolumn ,&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;) INTO @amount FROM &#039;&lt;/span&gt;, @itable ,&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039; WHERE(&#039;&lt;/span&gt;, @icolumn ,&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039; IS NOT NULL OR &#039;&lt;/span&gt;, @icolumn ,&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039; != &amp;quot;&amp;quot;);&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;INTO&lt;/span&gt; @testSql;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; PREPARE testSqlStmt &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FROM&lt;/span&gt; @testSql;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;-- Execute&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; EXECUTE testSqlStmt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;-- Check if we have 0 rows, else we still have data and we can&#039;t drop.&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;IF&lt;/span&gt; @amount = &lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt; THEN&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;-- Build the query&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;SELECT&lt;/span&gt; CONCAT&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;ALTER TABLE &#039;&lt;/span&gt;, @itable ,&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039; DROP COLUMN &#039;&lt;/span&gt;, @icolumn ,&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;;&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;INTO&lt;/span&gt; @alterSql;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;-- Execute&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; PREPARE alterSqlStmt &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FROM&lt;/span&gt; @alterSql;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; EXECUTE alterSqlStmt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;-- Update the status&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;SELECT&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;INTO&lt;/span&gt; succeeded;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; ELSE&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;SELECT&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;INTO&lt;/span&gt; succeeded;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; END &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;IF&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;END@@&lt;br /&gt;DELIMITER ;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;-- Conditionally drop the column &amp;quot;deprecated_column&amp;quot; from table &amp;quot;some_table&amp;quot;&lt;/span&gt;&lt;br /&gt;CALL drop_empty_column&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;some_table&#039;&lt;/span&gt;, &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;deprecated_column&#039;&lt;/span&gt;, @succeeded&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;-- Show the status&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;SELECT&lt;/span&gt; @succeeded;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;-- Cleanup&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;DROP&lt;/span&gt; PROCEDURE &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;IF&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;EXISTS&lt;/span&gt; drop_empty_column;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;I&#039;m fairly positive that this could be done in a much better way then that I&#039;m doing here, but this works too. Simply repeat the CALL drop_empty_column(..) for every table/column combination you want to DROP and update the definition of an &quot;empty column&quot; to what you want. Currently it drops the column only if the values contain nothing other then NULL or &quot;&quot; (empty string) values.&lt;/p&gt;&lt;p&gt;&lt;b&gt;Further reading:&lt;/b&gt; &lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/dev.mysql.com/tech-resources/articles/mysql-storedproc.html%20&#039;);&quot;  href=&quot;http://dev.mysql.com/tech-resources/articles/mysql-storedproc.html%20&quot; mce_href=&quot;http://dev.mysql.com/tech-resources/articles/mysql-storedproc.html &quot;&gt;http://dev.mysql.com/tech-resources/articles/mysql-storedproc.html&amp;#160;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/dev.mysql.com/doc/refman/5.0/en/create-procedure.html&#039;);&quot;  href=&quot;http://dev.mysql.com/doc/refman/5.0/en/create-procedure.html&quot; mce_href=&quot;http://dev.mysql.com/doc/refman/5.0/en/create-procedure.html&quot;&gt;http://dev.mysql.com/doc/refman/5.0/en/create-procedure.html&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt; 
    </content:encoded>

    <pubDate>Tue, 17 Aug 2010 13:54:00 +0200</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20100817_58.html</guid>
    <category>mysql</category>
<category>prepared statement</category>
<category>variable table name</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 21:58:00 +0200</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 07:24:00 +0200</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 16:47:00 +0200</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 08:39:00 +0100</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>Javascript printing a popup window</title>
    <link>http://blog.dynom.nl/archives/Javascript-printing-a-popup-window_20091029_52.html</link>
            <category>Javascript</category>
    
    <comments>http://blog.dynom.nl/archives/Javascript-printing-a-popup-window_20091029_52.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=52</wfw:comment>

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

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;p&gt;For the impatient, a working example:&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/dynom.nl/jquery/print_popup.html&#039;);&quot;  href=&quot;http://dynom.nl/jquery/print_popup.html&quot; mce_href=&quot;http://dynom.nl/jquery/print_popup.html&quot;&gt;http://dynom.nl/jquery/print_popup.html&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;It seems so easy, but I had some trouble printing a popup window containing an image. Whenever I printed the page using the following code it failed.&lt;div class=&quot;javascript&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;/**&lt;br /&gt;&amp;#160;* FAIL&lt;br /&gt;&amp;#160;*/&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt; printIt&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; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; win = window.&lt;span style=&quot;color: #000066;&quot;&gt;open&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;/path/to/image.jpg&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;Image&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;resizable=yes,...&#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: #000066; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;win&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; win.&lt;span style=&quot;color: #000066;&quot;&gt;focus&lt;/span&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; &amp;#160; &amp;#160; &amp;#160; &amp;#160; win.&lt;span style=&quot;color: #000066;&quot;&gt;print&lt;/span&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;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;false&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;&amp;#160;&lt;/p&gt;&lt;p&gt;So I changed from opening a URL to writing a IMG tag to the opened window, which works like a charm.
&lt;div class=&quot;javascript&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;/**&lt;br /&gt;&amp;#160;* Works like a charm.&lt;br /&gt;&amp;#160;*/&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt; printIt&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; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; win = window.&lt;span style=&quot;color: #000066;&quot;&gt;open&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;Image&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;resizable=yes,...&#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: #000066; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;win&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; win.&lt;span style=&quot;color: #006600;&quot;&gt;document&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;writeln&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;&amp;lt;img src=&amp;quot;/path/to/image&amp;quot; alt=&amp;quot;image&amp;quot;&amp;gt;&#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; &amp;#160; &amp;#160; &amp;#160; &amp;#160; win.&lt;span style=&quot;color: #006600;&quot;&gt;document&lt;/span&gt;.&lt;span style=&quot;color: #000066;&quot;&gt;close&lt;/span&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; &amp;#160; &amp;#160; &amp;#160; &amp;#160; win.&lt;span style=&quot;color: #000066;&quot;&gt;focus&lt;/span&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; &amp;#160; &amp;#160; &amp;#160; &amp;#160; win.&lt;span style=&quot;color: #000066;&quot;&gt;print&lt;/span&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;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;false&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;p&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;And to put it in jQuery terms: &lt;div class=&quot;javascript&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;/**&lt;br /&gt;&amp;#160;* To put it in jQuery terms:&lt;br /&gt;&amp;#160;*/&lt;/span&gt;&lt;br /&gt;Popup = &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; init : &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&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;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;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;a#action_print&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;bind&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;click&#039;&lt;/span&gt;, Popup.&lt;span style=&quot;color: #006600;&quot;&gt;printIt&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;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; printIt : &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&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;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;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; win = window.&lt;span style=&quot;color: #000066;&quot;&gt;open&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;Image&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;resizable=yes,...&#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; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;win.&lt;span style=&quot;color: #006600;&quot;&gt;document&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; &amp;#160; &amp;#160; &amp;#160; &amp;#160; win.&lt;span style=&quot;color: #006600;&quot;&gt;document&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;writeln&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;&amp;lt;img src=&amp;quot;&#039;&lt;/span&gt;+ $&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;attr&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;href&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; +&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;&amp;quot; alt=&amp;quot;image&amp;quot; /&amp;gt;&#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; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; win.&lt;span style=&quot;color: #006600;&quot;&gt;document&lt;/span&gt;.&lt;span style=&quot;color: #000066;&quot;&gt;close&lt;/span&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; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; win.&lt;span style=&quot;color: #000066;&quot;&gt;focus&lt;/span&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; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; win.&lt;span style=&quot;color: #000066;&quot;&gt;print&lt;/span&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; &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;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;false&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: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;document&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;ready&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&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;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; Popup.&lt;span style=&quot;color: #006600;&quot;&gt;init&lt;/span&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;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;&lt;/p&gt; 
    </content:encoded>

    <pubDate>Thu, 29 Oct 2009 15:25:47 +0100</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20091029_52.html</guid>
    
</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 11:17:00 +0200</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>Sorting of lists in jQuery</title>
    <link>http://blog.dynom.nl/archives/Sorting-of-lists-in-jQuery_20091006_49.html</link>
            <category>Javascript</category>
    
    <comments>http://blog.dynom.nl/archives/Sorting-of-lists-in-jQuery_20091006_49.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=49</wfw:comment>

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

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;p&gt;A while back I posted a simple sorting algorithm for number sorting, but it doesn&#039;t really do the trick for regular strings (e.g. anchors). But since I needed one recently I wrote another small and very simple sorting solution. &lt;/p&gt;&lt;p&gt;For a working example, see: &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/dynom.nl/jquery/listsort.php&#039;);&quot;  href=&quot;http://dynom.nl/jquery/listsort.php&quot; mce_href=&quot;http://dynom.nl/jquery/listsort.php&quot;&gt;http://dynom.nl/jquery/listsort.php&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;javascript&quot; style=&quot;text-align: left&quot;&gt;My.&lt;span style=&quot;color: #006600;&quot;&gt;List&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; Sort : &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;listSelector&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;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; sortedElements, left, right;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;// If we have any list items to sort on&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;$&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;listSelector + &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039; li&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;length&lt;/span&gt; &amp;gt; &lt;span style=&quot;color: #CC0000;&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;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;// Remove the items from the DOM&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; sortedElements = $&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;listSelector + &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039; li&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;remove&lt;/span&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;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;// Sort, using a custom sorting and compare by anchor contents&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; sortedElements.&lt;span style=&quot;color: #006600;&quot;&gt;sort&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;a, b&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; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; left = $&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;a&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;children&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;a&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;html&lt;/span&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; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; right = $&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;b&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;children&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;a&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;html&lt;/span&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;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;left &amp;gt; right&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; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #CC0000;&quot;&gt;1&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;right &amp;lt; left&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; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;return&lt;/span&gt; -&lt;span style=&quot;color: #CC0000;&quot;&gt;1&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span style=&quot;color: #000066; font-weight: bold;&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; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #CC0000;&quot;&gt;0&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &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; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&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; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;// Place the items back on the DOM&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; $&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;listSelector&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;append&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;sortedElements&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &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: #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;/div&gt;&lt;/p&gt;&lt;p&gt;Again, the source should be self explanatory&lt;/p&gt;&lt;p&gt;&amp;#160;&lt;/p&gt; 
    </content:encoded>

    <pubDate>Tue, 06 Oct 2009 13:00:00 +0200</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20091006_49.html</guid>
    <category>anchor</category>
<category>filter</category>
<category>javascript</category>
<category>jquery</category>
<category>link</category>
<category>list</category>
<category>sort</category>
<category>ul</category>

</item>
<item>
    <title>Click many, call once with jQuery</title>
    <link>http://blog.dynom.nl/archives/Click-many,-call-once-with-jQuery_20091006_48.html</link>
            <category>Javascript</category>
    
    <comments>http://blog.dynom.nl/archives/Click-many,-call-once-with-jQuery_20091006_48.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=48</wfw:comment>

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

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;p&gt;Recently I wanted to improve they way some anchors where handled in my recent project, it works a bit like adding and removing items to/from a list. But it was possible to trick the interface by quickly clicking multiple times on a link before the AJAX request was finished, while the back-end handled this without any problems, the interface for the visitor couldn&#039;t. And since I&#039;m a neat freak and I had a few minutes to spare, I came up with the following.&lt;/p&gt;&lt;p&gt;A working example: &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/dynom.nl/jquery/clickmanycallonce.html&#039;);&quot;  href=&quot;http://dynom.nl/jquery/clickmanycallonce.html&quot; mce_href=&quot;http://dynom.nl/jquery/clickmanycallonce.html&quot;&gt;http://dynom.nl/jquery/clickmanycallonce.html&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;
&lt;div class=&quot;javascript&quot; style=&quot;text-align: left&quot;&gt;My.&lt;span style=&quot;color: #006600;&quot;&gt;items&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; init : &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&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;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;span style=&quot;color: #009900; font-style: italic;&quot;&gt;// Bind the real item only once, and the dummy item permanently&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;// This way the *real* item is only called once, regardless of the amount of clicks&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;// And the link remains clickable but doesn&#039;t trigger the browser to follow it.&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; $&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;ul&amp;gt;li&amp;gt;a.item&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;one&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;click&#039;&lt;/span&gt;, My.&lt;span style=&quot;color: #006600;&quot;&gt;items&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;real_action&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;bind&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;click&#039;&lt;/span&gt;, My.&lt;span style=&quot;color: #006600;&quot;&gt;items&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;dummy_action&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;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; dummy_action : &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&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;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;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;html&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; $&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;html&lt;/span&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;span style=&quot;color: #3366CC;&quot;&gt;&#039;.&#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; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;false&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;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; real_action : &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&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;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;span style=&quot;color: #009900; font-style: italic;&quot;&gt;/* Fancy AJAX call, that shouldn&#039;t be executed more then once for every click */&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; $&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;div#frame&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;html&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;$&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;div#frame&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;html&lt;/span&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;span style=&quot;color: #3366CC;&quot;&gt;&quot;&amp;lt;br&amp;gt;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;Calling &#039;real_action&#039; for anchor: &quot;&lt;/span&gt; + $&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;html&lt;/span&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;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;false&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: #009900; font-style: italic;&quot;&gt;// When the DOM is ready&lt;/span&gt;&lt;br /&gt;$&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;document&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;ready&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&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;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;// Attach the filter to our input and list&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; My.&lt;span style=&quot;color: #006600;&quot;&gt;items&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;init&lt;/span&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;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&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;p&gt;While the code is fairly self explanatory and quite simple here the steps in a bit more detail:&lt;/p&gt;&lt;ol&gt;
  &lt;li&gt; Unobtrusively binding, as soon as the DOM is ready. &lt;/li&gt;
  &lt;li&gt; Binding the real action handler on &#039;click&#039; action with jQuery&#039;s  &#039;one()&#039; event handler &lt;/li&gt;
  &lt;li&gt; Binding the dummy action handler on &#039;click&#039; action with the &#039;bind()&#039; event handler &lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;This situation is probably only favorable if the item you click is removed from the DOM (or has actions re-bound after the call) else it might not be what you want.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Tue, 06 Oct 2009 12:28:00 +0200</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20091006_48.html</guid>
    <category>ajax</category>
<category>ignoring double click</category>
<category>javascript</category>
<category>jquery</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 07:23:00 +0200</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 17:35:00 +0200</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>

</channel>
</rss>
