<?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>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>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>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>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>

</channel>
</rss>
