<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>Derick Rethans - tag: work</title>
    <link>http://derickrethans.nl/feed-work.xml</link>
    <description>This feed shows the latest 15 items with the tag work</description>
    <language>en-us</language>
    <copyright>All rights reserved - Derick Rethans</copyright>
    <managingEditor>derick@derickrethans.nl (Derick Rethans)</managingEditor>
    <pubDate>Sun, 18 Dec 2011 09:30:06 +0000</pubDate>
    <lastBuildDate>Sun, 18 Dec 2011 09:30:06 +0000</lastBuildDate>
    <generator>eZ Components Feed dev (http://ezcomponents.org/docs/tutorials/Feed)</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>60</ttl>
    <item>
      <title>Xdebug no longer Open Source</title>
      <link>http://derickrethans.nl/xdebug-will-cost-money.html</link>
      <description>&lt;div class="article"&gt;
  &lt;div class="body"&gt;
    &lt;div class="articleListItem"&gt;
      &lt;h1&gt;&lt;a name="xdebug_no_longer_open_source"/&gt;Xdebug no longer Open Source&lt;/h1&gt;
      &lt;dl class="head"/&gt;
      &lt;div class="articleMetaData"&gt;
        &lt;div class="location"&gt; London, UK&lt;/div&gt;
        &lt;div class="date"&gt;Thursday, April 1st 2010, 10:19 BST&lt;/div&gt;
      &lt;/div&gt;
      &lt;p&gt;
        &lt;strong&gt;This was obviously an April Fools' joke, Xdebug will continue to stay Open Source and free of charge.&lt;/strong&gt;
      &lt;/p&gt;
      &lt;p&gt;Later today I will be releasing the first Release Candidate of Xdebug 2.1. With regret I have to announce that from this release, I will no longer provide Xdebug as an open source debugger extension. I've noticed that there are other projects making money of Xdebug's success while I only receive &lt;a href="http://xdebug.org/donate.php"&gt;donations&lt;/a&gt; from a group of awesome supporters.&lt;/p&gt;
      &lt;p&gt;Xdebug will continue to be available for benefactors on a limited number of platforms that I have access to (Linux 32/64bit and Windows). Please refer to the &lt;a href="http://derickrethans.nl/files/dump/faq.html"&gt;FAQ&lt;/a&gt; for further information.&lt;/p&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</description>
      <guid>201004011019</guid>
      <pubDate>Thu, 01 Apr 2010 09:19:00 +0000</pubDate>
    </item>
    <item>
      <title>Storing Date/Times in Databases</title>
      <link>http://derickrethans.nl/storing-date-time-in-database.html</link>
      <description>&lt;div class="article"&gt;
  &lt;div class="body"&gt;
    &lt;div class="articleListItem"&gt;
      &lt;h1&gt;&lt;a name="storing_date_times_in_databases"/&gt;Storing Date/Times in Databases&lt;/h1&gt;
      &lt;dl class="head"/&gt;
      &lt;div class="articleMetaData"&gt;
        &lt;div class="location"&gt; London, UK&lt;/div&gt;
        &lt;div class="date"&gt;Monday, March 29th 2010, 16:47 BST&lt;/div&gt;
      &lt;/div&gt;
      &lt;p&gt;After my talk during &lt;a href="http://confoo.ca/en"&gt;ConFoo&lt;/a&gt; on &lt;a href="http://confoo.ca/en/2010/session/advanced-date-time-handling-with-php"&gt;Advanced Date/Time Handling&lt;/a&gt; I received a question about whether the UTC-offset, together with the date/time in years, months, days, hours, minutes and seconds, was enough for storing a date/time in a database and still being able to do calculations with this. The answer to this question was no, but it lead to an even more interesting discussion about what &lt;em&gt;would&lt;/em&gt; be enough to store an accurate date/time in a database.&lt;/p&gt;
      &lt;p&gt;Firstly let me explain why storing a UTC offset is not adequate at all for doing any sort of calculations. Right now (March 25th, 2010), Montreal is on the same time as Santiago (in Chile) with both a UTC offset of -4 hours. This means that for the same date/time (&lt;code&gt;2010-03-25
19:03&lt;/code&gt;) the same timestamp is generated (&lt;code&gt;1269558180&lt;/code&gt;). However if we want to add eight months (&lt;code&gt;2010-11-25 19:03&lt;/code&gt;) to the current time for each of those locations then the timestamps &lt;em&gt;should&lt;/em&gt; be different — &lt;code&gt;1290729780&lt;/code&gt; for Montreal and &lt;code&gt;1290722580&lt;/code&gt; for Santiago. It turns out that &lt;em&gt;neither&lt;/em&gt; of them is exactly a full 24 hour difference from &lt;code&gt;2010-03-25 19:03&lt;/code&gt; as is shown the following script:&lt;/p&gt;
      &lt;pre&gt;&lt;?php
$s = '2010-03-25 19:03';
$montrealNow = date_create( "{$s} America/Montreal" )-&gt;format( 'U' );
$santiagoNow = date_create( "{$s} America/Santiago" )-&gt;format( 'U' );
$s = '2010-11-25 19:03';
$montrealThen = date_create( "{$s} America/Montreal" )-&gt;format( 'U' );
$santiagoThen = date_create( "{$s} America/Santiago" )-&gt;format( 'U' );

$hour = 60 * 60;
$day = 24 * $hour;

echo "Montreal:\n",
    $montrealNow, " - ",
    $montrealThen, "\n",
    ( ( $montrealThen - $montrealNow ) % $day ) / $hour, "\n\n";

echo "Santiago:\n",
    $santiagoNow, " - ",
    $santiagoThen, "\n",
    ( ( $santiagoThen - $santiagoNow ) % $day ) / $hour, "\n\n";

?&gt;

&lt;/pre&gt;
      &lt;p&gt;which gives the output:&lt;/p&gt;
      &lt;pre&gt;Montreal:
1269558180 - 1290729780
1

Santiago:
1269558180 - 1290722580
23

&lt;/pre&gt;
      &lt;p&gt;From this we see that Montreal has an extra hour and Santiago has an hour less. This is because Montreal changed from Daylight Savings Time to normal time and Santiago, being on the southern hemisphere, moved from normal time to Daylight Savings time.&lt;/p&gt;
      &lt;p&gt;Now if we had only the timestamp (&lt;code&gt;1269558180&lt;/code&gt;) and the UTC-offset, the only thing we could do would be to advance a specific number of days. In this case, there are 245 days, which makes (&lt;code&gt;245 * 24 * 60 * 60 =&lt;/code&gt; ) &lt;code&gt;21168000&lt;/code&gt; seconds. If we add this to the original timestamp, we end up at &lt;code&gt;1290726180&lt;/code&gt; which corresponds to &lt;code&gt;2010-11-25 18:03&lt;/code&gt; Montreal time, or &lt;code&gt;2010-11-25 20:03&lt;/code&gt; Santiago time. Neither of them being the correct &lt;code&gt;2010-11-25 19:03&lt;/code&gt;. Because from the UTC offset of 4 hours we don't know whether we're in Montreal or Santiago, we can conclude that with just this UTC offset and the original timestamp we can't calculate the timestamp of something that's 8 months in the future. Storing the UTC-offset can not change this fact either.&lt;/p&gt;
      &lt;p&gt;In order to to proper calculations, you need to keep information about the timezone itself. In PHP timezones are identified with identifiers such as &lt;code&gt;America/Montreal&lt;/code&gt;. If we store those alongside the timestamps, we can do the proper calculations. The following example demonstrates that:&lt;/p&gt;
      &lt;pre&gt;&lt;?php
$timestamp = 1269558180;
$tzid      = 'America/Montreal';

$d = new DateTime( "@$timestamp" );
$d-&gt;setTimeZone( new DateTimeZone( $tzid ) );
$d-&gt;modify( '+8 months' );

echo $d-&gt;format( 'Y-m-d H:i' ), "\n";
?&gt;

&lt;/pre&gt;
      &lt;p&gt;which gives the output: &lt;code&gt;2010-11-25 19:03&lt;/code&gt;.&lt;/p&gt;
      &lt;p&gt;This seems to work, but unfortunately, even the approach of storing the timestamp and timezone identifier is not going to work correctly under certain circumstances. In order to find out why, we have to go back to January this year.&lt;/p&gt;
      &lt;p&gt;Imagine that in January this year—January 15th to be precise—we run the following script to determine the timestamp of a date/time two months in the future:&lt;/p&gt;
      &lt;pre&gt;&lt;?php
$tz = 'America/Santiago';
$ts = date_create( "2010-01-15 10:41 $tz" )-&gt;format( 'U' );

$d = new DateTime( "@$ts" );
$d-&gt;setTimeZone( new DateTimeZone( $tz ) );
$d-&gt;modify( '+2 months' );

echo $d-&gt;format( 'U Y-m-d H:i' ), "\n";
?&gt;

&lt;/pre&gt;
      &lt;p&gt;This returns the timestamp &lt;code&gt;1268664060&lt;/code&gt; for the date/time &lt;code&gt;2010-03-15
10:41:00&lt;/code&gt;.&lt;/p&gt;
      &lt;p&gt;Now skip forwards to the current date and time. If we used this calculated timestamp and the timezone identifier &lt;code&gt;America/Santiago&lt;/code&gt; today to generate a date/time string, we would however get a different output. The following example shows this:&lt;/p&gt;
      &lt;pre&gt;&lt;?php
$tz = 'America/Santiago';
$d = date_create( "@1268664060" );
$d-&gt;setTimeZone( new DateTimeZone( $tz ) );

echo $d-&gt;format( 'Y-m-d H:i:s' ), "\n";
?&gt;

&lt;/pre&gt;
      &lt;p&gt;which gives the output: &lt;code&gt;2010-03-15 11:41:00&lt;/code&gt; (and not &lt;code&gt;2010-03-15
10:41:00&lt;/code&gt;).&lt;/p&gt;
      &lt;p&gt;The difference in output is not a bug, but is caused because some countries change Daylight Savings Time rules quite frequently. In this case Chile decided (on March 4th) that instead of going forwards to DST at midnight March 14th, they will delay that to April 4th. When we ran the code on January 15th, the rules still thought that March 15th would already be on normal time again, outside of DST. But running the code now, with the updated rule set, we find that DST is still in effect until April 4th. The following example shows the transitions from/to DST for Santiago in 2010:&lt;/p&gt;
      &lt;pre&gt;&lt;?php
$tzid = "America/Santiago";

$tz = new DateTimeZone( $tzid );
$transitions = $tz-&gt;getTransitions(
    strtotime( '2010-01-01 00:00 UTC' ),
    strtotime( '2010-12-31 00:00 UTC' )
);

foreach ( $transitions as $t )
{
    echo $t['time'], ' ', $t['offset'] / 3600, ' ', $t['abbr'], "\n";
}
?&gt;

&lt;/pre&gt;
      &lt;p&gt;If we run this script with PHP 5.3.1 or 5.3.2—which still have the old incorrect rule set—the output is:&lt;/p&gt;
      &lt;pre&gt;2010-01-01T00:00:00+0000 -3 CLST
2010-03-14T03:00:00+0000 -4 CLT
2010-10-10T04:00:00+0000 -3 CLST

&lt;/pre&gt;
      &lt;p&gt;In the SVN repository, the rule set has been updated, so snapshots of PHP 5.3-dev have the correct rules and the script will show:&lt;/p&gt;
      &lt;pre&gt;2010-01-01T00:00:00+0000 -3 CLST
2010-04-04T03:00:00+0000 -4 CLT
2010-10-10T04:00:00+0000 -3 CLST

&lt;/pre&gt;
      &lt;p&gt;This leads to the conclusion that storing timestamps and timezone identifiers is not good enough either, unless you want an &lt;em&gt;exact&lt;/em&gt; point in time, as opposed to the more expected date/time in a location. So how &lt;em&gt;should&lt;/em&gt; you store the latter then? Basically, in the same way that DateTime objects are serialized in PHP 5.3. Let us imagine again, that the following code is run on January 15th again:&lt;/p&gt;
      &lt;pre&gt;&lt;?php
$tzid = 'America/Santiago';
$d = new DateTime( "2010-01-15 10:41 $tzid" );
$d-&gt;modify( '+2 months' );
$s = $d-&gt;format( 'Y-m-d H:i:s' );
$ts = $d-&gt;format( 'U' );
echo "$s (ts=$ts)\n";
?&gt;

&lt;/pre&gt;
      &lt;p&gt;which gives the output &lt;code&gt;2010-03-15 10:41:00 (ts=1268664060)&lt;/code&gt;. The next example is run with a recent rule set (such as in PHP SVN) today:&lt;/p&gt;
      &lt;pre&gt;&lt;?php
$tzid = 'America/Santiago';
$d = new DateTime( "$s $tzid" );
$s = $d-&gt;format( 'Y-m-d H:i:s' );
$ts = $d-&gt;format( 'U' );
echo "$s (ts=$ts)\n";
?&gt;

&lt;/pre&gt;
      &lt;p&gt;which gives the output &lt;code&gt;2010-03-15 10:41:00 (ts=1268660460)&lt;/code&gt;. As you can see, now the date/time itself is correct, although there is a different timestamp. PHP's DateTime serialisation does something similar:&lt;/p&gt;
      &lt;pre&gt;&lt;?php
$d = new DateTime();
$d-&gt;setTimeZone( new DateTimeZone( 'America/Santiago' ) );
var_dump( $d );
?&gt;

&lt;/pre&gt;
      &lt;p&gt;which gives the output:&lt;/p&gt;
      &lt;pre&gt;object(DateTime)#1 (3) {
  ["date"]=&gt;
  string(19) "2010-03-29 11:32:08"
  ["timezone_type"]=&gt;
  int(3)
  ["timezone"]=&gt;
  string(16) "America/Santiago"
}

&lt;/pre&gt;
      &lt;p&gt;For things to work correctly, you need to have an up-to-date rule set. PHP versions are not released as often as the timezonedb (sometimes more than 20 times a year) and to address this issue you can install the pecl extension &lt;a href="http://pecl.php.net/package/timezonedb"&gt;timezonedb&lt;/a&gt; with &lt;code&gt;pecl install timezonedb&lt;/code&gt;.&lt;/p&gt;
      &lt;p&gt;To store information in a database, I would use a &lt;code&gt;char&lt;/code&gt; column-type to store the whole &lt;code&gt;America/Santiago&lt;/code&gt; timezone identifier and another &lt;code&gt;char&lt;/code&gt; column-type to store the date/time (in the &lt;code&gt;yyyy-mm-dd
hh:ii:ss&lt;/code&gt; format).  Alternatively, you can pick a 'datetime' column-type, as long as that type &lt;strong&gt;ignores&lt;/strong&gt; timezones altogether. For MySQL that is the &lt;code&gt;DATETIME&lt;/code&gt; column-type, and for PostgreSQL the &lt;code&gt;TIMESTAMP&lt;/code&gt; or &lt;code&gt;TIMESTAMP WITHOUT TIME ZONE&lt;/code&gt; column-types.&lt;/p&gt;
      &lt;p&gt;Databases rarely handle timezones, daylight savings time and rule changes correctly, so avoid the database specific functionality all together. Using either a &lt;code&gt;char&lt;/code&gt; or a timezone-less 'datetime' column-type would still allow you to sort and by using a 'datetime' column-type you can even do calculations.&lt;/p&gt;
      &lt;p&gt;Happy summer time!&lt;/p&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</description>
      <guid>201003291647</guid>
      <pubDate>Mon, 29 Mar 2010 15:47:00 +0000</pubDate>
    </item>
    <item>
      <title>Available for PHP Extension Writing</title>
      <link>http://derickrethans.nl/available-for-php-extension-writing.html</link>
      <description>&lt;div class="article"&gt;
  &lt;div class="body"&gt;
    &lt;div class="articleListItem"&gt;
      &lt;h1&gt;&lt;a name="available_for_php_extension_writing"/&gt;Available for PHP Extension Writing&lt;/h1&gt;
      &lt;dl class="head"/&gt;
      &lt;div class="articleMetaData"&gt;
        &lt;div class="location"&gt; London, UK&lt;/div&gt;
        &lt;div class="date"&gt;Monday, March 15th 2010, 12:28 GMT&lt;/div&gt;
      &lt;/div&gt;
      &lt;p&gt;Slightly more than a month ago I left my job as team-lead of &lt;a href="http://ezcomponents.org"&gt;eZ Components&lt;/a&gt; at &lt;a href="http://ez.no"&gt;eZ Systems&lt;/a&gt; behind, to focus on something new. During the past month I've been contemplating about what to do next and realized that I do not want to take on a new full-time position right away.  Instead I will be available to work on (custom) PHP extensions and internals related issues. Extensions are a great way around PHP's limitations and performance issues.&lt;/p&gt;
      &lt;p&gt;As first project I am working on a "&lt;a href="https://github.com/derickr/quickhash"&gt;QuickHash&lt;/a&gt;" extension for &lt;a href="http://www.stumbleupon.com/"&gt;StumbleUpon&lt;/a&gt;. This extension circumvents PHP's hefty memory (and performance) overhead by providing more specific data structures. The extension currently implements integer sets and integer to integer hashes. I am now adding integer to string hashes and string to integer hashes. The QuickHash extension will be released under the PHP Licence and I will dedicate another post to it later.&lt;/p&gt;
      &lt;p&gt;If, like &lt;a href="http://www.stumbleupon.com/"&gt;StumbleUpon&lt;/a&gt;, you are also interested in having work done on PHP or a specific extensions feel free to &lt;a href="http://derickrethans.nl/who.html"&gt;contact&lt;/a&gt; me. I'd be happy to discuss things with you.&lt;/p&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</description>
      <guid>201003151228</guid>
      <pubDate>Mon, 15 Mar 2010 12:28:00 +0000</pubDate>
    </item>
    <item>
      <title>New Xdebug browser extensions</title>
      <link>http://derickrethans.nl/new-xdebug-helper.html</link>
      <description>&lt;div class="article"&gt;
  &lt;div class="body"&gt;
    &lt;div class="articleListItem"&gt;
      &lt;h1&gt;&lt;a name="new_xdebug_browser_extensions"/&gt;New Xdebug browser extensions&lt;/h1&gt;
      &lt;dl class="head"/&gt;
      &lt;div class="articleMetaData"&gt;
        &lt;div class="location"&gt; London, UK&lt;/div&gt;
        &lt;div class="date"&gt;Wednesday, February 17th 2010, 12:33 GMT&lt;/div&gt;
      &lt;/div&gt;
      &lt;p&gt;Years ago I &lt;a href="http://derickrethans.nl/starting-xdebugs-debugger-with-firefox.html"&gt;wrote&lt;/a&gt; about a Firefox extension that allows you to start an &lt;a href="http://xdebug.org"&gt;Xdebug&lt;/a&gt; debugging session by clicking on an icon in Firefox' status bar. For some unexplained reason, this extension is no longer available through Firefox' addon-site. Although I have a copy at &lt;a href="http://xdebug.org/files/xdebug_helper-0.3.1-fx.xpi"&gt;http://xdebug.org/files/xdebug_helper-0.3.1-fx.xpi&lt;/a&gt; for archival purposes, there are now a few other browser extensions that do the same thing.&lt;/p&gt;
      &lt;p&gt;
        &lt;strong&gt;easy Xdebug&lt;/strong&gt;
      &lt;/p&gt;
      &lt;p&gt;&lt;a href="https://addons.mozilla.org/en-US/firefox/addon/58688"&gt;easy Xdebug&lt;/a&gt; is an extension that serves as a replacement for the now unavailable Xdebug helper extension. It's written by &lt;a href="https://addons.mozilla.org/en-US/firefox/user/5114063"&gt;Brecht Vanhaesebrouck&lt;/a&gt; of &lt;a href="http://www.elime.be/"&gt;eLime&lt;/a&gt;. The extension was originally tested with &lt;a href="http://netbeans.org/"&gt;Netbeans&lt;/a&gt; but it also seems to work fine with &lt;a href="http://www.activestate.com/komodo/"&gt;Komodo&lt;/a&gt;.&lt;/p&gt;
      &lt;p&gt;
        &lt;strong&gt;Xdebug enabler&lt;/strong&gt;
      &lt;/p&gt;
      &lt;p&gt;&lt;a href="http://blog.remailed.net/2010/01/xdebug-enabler-v0-2/"&gt;Xdebug enabler&lt;/a&gt; is an extension for Google's Chrome browser. It &lt;em&gt;"allows you to enable and disable triggering Xdebug from with in Chrome. Useful if you are a web developer using an IDE that supports Xdebug like Eclipse with PDT."&lt;/em&gt; It's written by 'remailednet' and available through the &lt;a href="https://chrome.google.com/extensions/detail/eippbhbeglgcphcjmpjcjinjamabeoln"&gt;Google Chrome Extensions&lt;/a&gt; website.&lt;/p&gt;
      &lt;p&gt;
        &lt;strong&gt;JavaScript 'enabler'&lt;/strong&gt;
      &lt;/p&gt;
      &lt;p&gt;I also ran across a &lt;a href="http://highervisibilitywebsites.com/simple-cross-browser-xdebug-helper-session-starter-and-stopper-no-add-ons-needed"&gt;blog post&lt;/a&gt; by 'Caleb G' from &lt;a href="http://highervisibilitywebsites.com/"&gt;HigherVisibility&lt;/a&gt;. Instead of making an extension for a specific browser, he outlines two JavaScript bookmarklets that allow you to start and stop an &lt;a href="http://xdebug.org"&gt;Xdebug&lt;/a&gt; debugging session.&lt;/p&gt;
      &lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; The "Xdebug enabler" Chrome Extension seems to have some issues. There is now also an alternative Chrome Extension called &lt;strong&gt;Xdebug helper&lt;/strong&gt; that integrates quite a bit better. You can find it at its &lt;a href="https://chrome.google.com/extensions/detail/eadndfjplgieldjbigjakmdgkmoaaaoc"&gt;Google Chrome Extension&lt;/a&gt; page.&lt;/p&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</description>
      <guid>201002171233</guid>
      <pubDate>Wed, 17 Feb 2010 12:33:00 +0000</pubDate>
    </item>
    <item>
      <title>New website layout</title>
      <link>http://derickrethans.nl/new-layout.html</link>
      <description>&lt;div class="article"&gt;
  &lt;div class="body"&gt;
    &lt;div class="articleListItem"&gt;
      &lt;h1&gt;&lt;a name="new_website_layout"/&gt;New website layout&lt;/h1&gt;
      &lt;dl class="head"/&gt;
      &lt;div class="articleMetaData"&gt;
        &lt;div class="location"&gt; London, UK&lt;/div&gt;
        &lt;div class="date"&gt;Saturday, December 26th 2009, 15:13 UTC&lt;/div&gt;
      &lt;/div&gt;
      &lt;p&gt;Just like Xdebug's server was moved&lt;a href="http://derickrethans.nl#_footnote_0_1" class="footnote"&gt;1&lt;/a&gt; to a new VPS at &lt;a href="http://www.xtrahost.co.uk/"&gt;XtraHosting&lt;/a&gt; so did my personal website (the one you're looking at). Hosting it on my own gives me full control over what software runs it, and which PHP version and extensions I run. I switched most of the code from a PHP 4.1 atrocity to PHP 5.3 goodness.&lt;/p&gt;
      &lt;p&gt;At the same time, I also moved all the contents from some self-invented XML format to &lt;a href="http://docutils.sourceforge.net/rst.html"&gt;reStructuredText&lt;/a&gt;. reStructuredText is a format that can be parsed and transformed into other formats by &lt;a href="http://ezcomponents.org/"&gt;eZ Components&lt;/a&gt;' &lt;a href="http://ezcomponents.org/s/Document"&gt;Document&lt;/a&gt; component. Right now I am transforming to HTML only, but in the future I will also transform certain articles to PDFs. Comments can also make use of some of the reStructuredText formatting options, but there are still some things that need sorting out there.&lt;/p&gt;
      &lt;p&gt;Besides changing the layout and converting the content to a more manageable format, I also introduced a stream of &lt;a href="http://dopplr.com"&gt;dopplr&lt;/a&gt;, &lt;a href="http://flickr.com"&gt;flickr&lt;/a&gt; and &lt;a href="http://twitter.com"&gt;twitter&lt;/a&gt; updates on the right side. This is implemented by parsing the relative RSS feeds from the different sources. If location information is present, this is also shown in this feed. Previously I would only export an RSS feed for all of the content, but with this site update, there is now a feed for every tag that I've used. All RSS functionality is provided by the &lt;a href="http://ezcomponents.org/s/Feed"&gt;Feed&lt;/a&gt; component of &lt;a href="http://ezcomponents.org/"&gt;eZ Components&lt;/a&gt; (although a patch is currently needed for the location information).&lt;/p&gt;
      &lt;p&gt;I'm not a 100% happy with the new layout, so most likely I will be doing some changes in the near future.&lt;/p&gt;
      
    &lt;/div&gt;
    &lt;ul class="footnotes"&gt;
      &lt;li&gt;
        &lt;a name="_footnote_0_1"&gt;1&lt;/a&gt;
        &lt;p&gt;&lt;a href="http://derickrethans.nl/xdebug-moved-to-a-new-server.html"&gt;http://derickrethans.nl/xdebug-moved-to-a-new-server.html&lt;/a&gt;&lt;/p&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;
&lt;/div&gt;
</description>
      <guid>200912261513</guid>
      <pubDate>Sat, 26 Dec 2009 15:13:00 +0000</pubDate>
    </item>
    <item>
      <title>Xdebug and tracing memory usage</title>
      <link>http://derickrethans.nl/xdebug-and-tracing-memory-usage.html</link>
      <description>&lt;div class="article"&gt;
  &lt;div class="body"&gt;
    &lt;div class="articleListItem"&gt;
      &lt;h1&gt;&lt;a name="xdebug_and_tracing_memory_usage"/&gt;Xdebug and tracing memory usage&lt;/h1&gt;
      &lt;dl class="head"/&gt;
      &lt;div class="articleMetaData"&gt;
        &lt;div class="location"&gt; London, UK&lt;/div&gt;
        &lt;div class="date"&gt;Friday, November 13th 2009, 11:59 GMT&lt;/div&gt;
      &lt;/div&gt;
      &lt;p&gt;Recently people started to ask me how to use &lt;a href="http://xdebug.org"&gt;Xdebug&lt;/a&gt; to figure out which parts of applications use a lot of memory. Traditionally this was part of Xdebug's &lt;a href="http://xdebug.org/docs/profiler"&gt;profiling&lt;/a&gt; functionality. Unfortunately the cachegrind format didn't fit this so well, and because it returned incorrect data I removed this functionality from the profiler. However, there is other functionality in Xdebug that does provide the correct data: the &lt;a href="http://xdebug.org/docs/execution_trace"&gt;function traces&lt;/a&gt;.&lt;/p&gt;
      &lt;p&gt;Function traces log every include, function call and method call to a file. If the &lt;a href="http://xdebug.org/docs/execution_trace#trace_format"&gt;xdebug.trace_format&lt;/a&gt; setting is set to "1" then the trace file is an easy-to-parse tab separated format. The information that is logged includes the time-index when the function started and ended, and it also contains the amount of memory that was in use when entering the function, as well as when leaving it. With the last two numbers it's rather trivial to write a script to figure out which functions/methods increase the memory usage a lot. Of course, nobody had written a script yet to do anything with this information&lt;/p&gt;
      &lt;p&gt;As part of my preparations for my Xdebug talk at &lt;a href="http://phpconference.com"&gt;IPC&lt;/a&gt; next week, I now have written such a script. The script parses the tab-separated function trace files and aggregates all the information by function name. You can sort the output on a few different keys: time-own, memory-own, time-inclusive, memory-inclusive and calls. You can also configure how many elements it will show. As an example here is some output from a trace of one of the presentation system's PHP scripts:&lt;/p&gt;
      &lt;pre&gt;$ php tracefile-analyser.php trace.2043925204.xt memory-own 20

&lt;/pre&gt;
      &lt;pre&gt;parsing...
Done.
Showing the 20 most costly calls sorted by 'memory-own'.
                                               Inclusive        Own
function                               #calls  time     memory  time     memory
-------------------------------------------------------------------------------
require_once                                9  0.0541  4595160  0.0277  2548104
{main}                                      1  0.0600  2906032  0.0034   249744
fread                                       4  0.0001    33296  0.0001    33296
session_start                               1  0.0002    31824  0.0002    31824
XML_Presentation-&gt;startHandler             38  0.0073    36360  0.0035    18424
_pres_slide-&gt;_pres_slide                   27  0.0009    10152  0.0009    10152
_presentation-&gt;_presentation                1  0.0001     7912  0.0001     7912
strtolower                                 67  0.0017     6456  0.0017     6456
compact                                     1  0.0000     4832  0.0000     4832
each                                        5  0.0001     4320  0.0001     4320
XML_Presentation-&gt;endHandler               38  0.0014     3800  0.0014     3960
_slide-&gt;_slide                              1  0.0001     3896  0.0001     3896
XML_Slide-&gt;startHandler                     4  0.0009    10800  0.0004     3736
_image-&gt;_image                              1  0.0000     3040  0.0000     3040
fopen                                       2  0.0001     2816  0.0001     2816
getimagesize                                1  0.0001     2296  0.0001     2296
display-&gt;display                            1  0.0001     2120  0.0001     2120
explode                                     2  0.0001     2120  0.0001     2120
xml_parser_create                           2  0.0001     1680  0.0001     1680
XML_Parser-&gt;_initHandlers                   2  0.0011     1600  0.0005     1360

&lt;/pre&gt;
      &lt;p&gt;The script is available from SVN by running:&lt;/p&gt;
      &lt;pre&gt;svn co svn://svn.xdebug.org:/svn/xdebug/xdebug/trunk/contrib xdebug/contrib

&lt;/pre&gt;
      &lt;p&gt;The script to run is then "tracefile-analyser.php" from inside the "xdebug/contrib" directory.&lt;/p&gt;
      &lt;p&gt;&lt;strong&gt;Update 2009-12-28&lt;/strong&gt;: Changed the CVS instructions to the new SVN instructions.&lt;/p&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</description>
      <guid>200911131159</guid>
      <pubDate>Fri, 13 Nov 2009 11:59:00 +0000</pubDate>
    </item>
    <item>
      <title>Unix Epoch and PHP's calendar system</title>
      <link>http://derickrethans.nl/unix-epoch-and-phps-calendar-system.html</link>
      <description>&lt;div class="article"&gt;
  &lt;div class="body"&gt;
    &lt;div class="articleListItem"&gt;
      &lt;h1&gt;&lt;a name="unix_epoch_and_php_s_calendar_system"/&gt;Unix Epoch and PHP's calendar system&lt;/h1&gt;
      &lt;dl class="head"/&gt;
      &lt;div class="articleMetaData"&gt;
        &lt;div class="location"&gt; London, UK&lt;/div&gt;
        &lt;div class="date"&gt;Thursday, November 12th 2009, 12:32 GMT&lt;/div&gt;
      &lt;/div&gt;
      &lt;p&gt;I just saw a &lt;a href="http://news.php.net/php.doc.cvs/5325"&gt;commit&lt;/a&gt; flying past as a response to &lt;a href="http://bugs.php.net/bug.php?edit=1&amp;id=50155"&gt;PHP bug #50155&lt;/a&gt;. While &lt;em&gt;right&lt;/em&gt; now it is proper to define the Unix Epoch at "1970-01-01 00:00:00 UTC", UTC wasn't actually defined until 1972. So it would be more correct to define the Unix Epoch as "the number of seconds elapsed since midnight &lt;a href="http://dictionary.reference.com/browse/proleptic"&gt;proleptic&lt;/a&gt; Coordinated Universal Time (UTC) of January 1, 1970, not counting leap seconds." (from Wikipedia). What the bit "not counting leap seconds" means, I've already explained before in &lt;a href="http://derickrethans.nl/leap_seconds_and_what_to_do_with_them.php"&gt;Leap Seconds and What To Do With Them&lt;/a&gt;.&lt;/p&gt;
      &lt;p&gt;Similarly, PHP's internal calendar is the &lt;a href="http://en.wikipedia.org/wiki/ISO_8601#Years"&gt;ISO 8601 calendar&lt;/a&gt;. This is a modification of the proleptic &lt;a href="http://en.wikipedia.org/wiki/Gregorian_calendar"&gt;Gregorian&lt;/a&gt; calendar. The Gregorian calendar implements the current set of leap years every 4 years, but not every 100 years, but again every 400 years (to get to an average year length of 365.2425 days). Obviously this calendar is only in use since 1582 (some countries adopted it as late as the 1900s), so using days like 1066-10-14 in the Gregorian calendar makes little sense because that calendar didn't exist back then. Now, PHP's ISO 8601-based calendar even modifies the Gregorian calendar by including the year 0. The Gregorian calendar goes straight from -1 to 1 which is a pain to do proper date calculations with. Therefore the ISO 8601 calendar uses &lt;a href="http://en.wikipedia.org/wiki/Astronomical_year_numbering"&gt;Astronomical year numbering&lt;/a&gt;.&lt;/p&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</description>
      <guid>200911121232</guid>
      <pubDate>Thu, 12 Nov 2009 12:32:00 +0000</pubDate>
    </item>
    <item>
      <title>Good bye eZ Systems</title>
      <link>http://derickrethans.nl/good-bye-ez-systems.html</link>
      <description>&lt;div class="article"&gt;
  &lt;div class="body"&gt;
    &lt;div class="articleListItem"&gt;
      &lt;h1&gt;&lt;a name="good_bye_ez_systems"/&gt;Good bye eZ Systems&lt;/h1&gt;
      &lt;dl class="head"/&gt;
      &lt;div class="articleMetaData"&gt;
        &lt;div class="location"&gt; London, UK&lt;/div&gt;
        &lt;div class="date"&gt;Tuesday, October 27th 2009, 10:36 GMT&lt;/div&gt;
      &lt;/div&gt;
      &lt;p&gt;During the past 6 years I've been working as a developer for &lt;a href="http://ez.no"&gt;eZ Systems&lt;/a&gt; — first as a developer on eZ Publish and later as project lead for &lt;a href="http://ezcomponents.org"&gt;eZ Components&lt;/a&gt;. Working on a project like &lt;a href="http://ezcomponents.org"&gt;eZ Components&lt;/a&gt; as lead was challenging and interesting and taught me many things. &lt;a href="http://ez.no"&gt;eZ Systems&lt;/a&gt; as a company is changing a lot, and now the time has come for me to move on and find something new and exciting to do. I've recently &lt;a href="http://derickrethans.nl/good_bye_norway_hello_london.php"&gt;moved to London&lt;/a&gt; to explore life from a different point of view, and that will now also include a search for a new challenge professionally. I will still be with eZ Systems for awhile longer to finish the next &lt;a href="http://ezcomponents.org"&gt;eZ Components&lt;/a&gt; release. If you think you can provide me with a new challenge, feel free to contact &lt;a href="http://derickrethans.nl/who.php"&gt;me&lt;/a&gt;.&lt;/p&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</description>
      <guid>200910271036</guid>
      <pubDate>Tue, 27 Oct 2009 10:36:00 +0000</pubDate>
    </item>
    <item>
      <title>Autumn Plans</title>
      <link>http://derickrethans.nl/autumn-plans.html</link>
      <description>&lt;div class="article"&gt;
  &lt;div class="body"&gt;
    &lt;div class="articleListItem"&gt;
      &lt;h1&gt;&lt;a name="autumn_plans"/&gt;Autumn Plans&lt;/h1&gt;
      &lt;dl class="head"/&gt;
      &lt;div class="articleMetaData"&gt;
        &lt;div class="location"&gt; London, UK&lt;/div&gt;
        &lt;div class="date"&gt;Monday, September 14th 2009, 13:26 BST&lt;/div&gt;
      &lt;/div&gt;
      &lt;p&gt;I've been missing-in-action on my own blog for some time. Moving to London does that to you. Anyway, I've not been idle in the meanwhile at all, and been working on some cool side-projects. First of all I've been adding some features to &lt;a href="http://xdebug.org"&gt;Xdebug&lt;/a&gt; . Xdebug is now slow reaching beta-status for the 2.1 release. New feature will include proper PHP 5.3 support, variable tracing, "scream" support and other minor features.&lt;/p&gt;
      &lt;p&gt;Besides Xdebug I've also been hacking on PHP-GTK applications for my &lt;a href="http://wiki.openmoko.org/wiki/Main_Page"&gt;phone&lt;/a&gt; . The major new thing that I have now is a PHP-GTK twitter client that works like I want it... and I even use it on my desktop instead of all the other stuff that's out there. I will soon be publishing this client in my CVS repository.&lt;/p&gt;
      &lt;p&gt;Now that the conference season is starting again I'm working on improving several talks, as well as rewriting some parts for them. The first conference that I will be speaking at, are part of &lt;a href="http://mtabini.blogspot.com/"&gt;"Marco's Crazy PHP Conference Tour"&lt;/a&gt; aka &lt;a href="http://cw.mtacon.com"&gt;CodeWorks&lt;/a&gt; . I'll be giving three different talks here, one on "Debugging with &lt;a href="http://xdebug.org"&gt;Xdebug&lt;/a&gt; ", one on PHP's &lt;a href="http://phpdatebook.com"&gt;DateTime support&lt;/a&gt; and one on "Improving your development process" where I'll be talking about Test-Driven Development and other tricks associated by running a project. As CodeWorks is a bit like a rock-star tour, I'll be keeping a video blog of it somewhere on the intertubes.&lt;/p&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</description>
      <guid>200909141326</guid>
      <pubDate>Mon, 14 Sep 2009 12:26:00 +0000</pubDate>
    </item>
    <item>
      <title>Good bye Norway, Hello London</title>
      <link>http://derickrethans.nl/good-bye-norway-hello-london.html</link>
      <description>&lt;div class="article"&gt;
  &lt;div class="body"&gt;
    &lt;div class="articleListItem"&gt;
      &lt;h1&gt;&lt;a name="good_bye_norway_hello_london"/&gt;Good bye Norway, Hello London&lt;/h1&gt;
      &lt;dl class="head"/&gt;
      &lt;div class="articleMetaData"&gt;
        &lt;div class="location"&gt; Skien, Norway&lt;/div&gt;
        &lt;div class="date"&gt;Sunday, June 21st 2009, 02:32 CEST&lt;/div&gt;
      &lt;/div&gt;
      &lt;p&gt;Today, at the longest day of the year at the &lt;a href="http://en.wikipedia.org/wiki/Solstice"&gt;summer solstice&lt;/a&gt; , I am making a bit change to my life. If you're following me on &lt;a href="http://twitter.com/derickr"&gt;twitter&lt;/a&gt; you probably already know what I'm up to. For everybody else, I am going to say good bye to Skien in Norway, and move to London (the one in England, and not the one in Ontario). Norway has been my home for the past five years, and I've had a great time exploring the nature as well as working at &lt;a href="http://ez.no"&gt;our&lt;/a&gt; office in &lt;a href="http://en.wikipedia.org/wiki/Skien"&gt;Skien&lt;/a&gt; . Skien is a nice place, but ... not the most interesting of cities in the world. From today I will be living in London to see what life will bring me there. I am both sad to leave Norway, but I am also excited to live in a cool new place like London. I'll have awesome house mates (Hi, Mr. Þorbjörnsson, Ms. Cherry and Mr. Ray!!), and something new to put my energy in. I will continue to work as project leader for &lt;a href="http://ezcomponents.org"&gt;eZ Components&lt;/a&gt; for &lt;a href="http://ez.no"&gt;eZ Systems&lt;/a&gt; and continue to make great software with Alexandru, &lt;a href="http://schlitt.info/opensource.html"&gt;Tobias&lt;/a&gt; , &lt;a href="http://kore-nordmann.de/blog"&gt;Kore&lt;/a&gt; and &lt;a href="http://sebastian-bergmann.de/"&gt;Sebastian&lt;/a&gt; . If you are about in London, let me know! We could go for a pint or something. See you there!&lt;/p&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</description>
      <guid>200906210232</guid>
      <pubDate>Sun, 21 Jun 2009 00:32:00 +0000</pubDate>
    </item>
    <item>
      <title>Debugging with multiple users</title>
      <link>http://derickrethans.nl/debugging-with-multiple-users.html</link>
      <description>&lt;div class="article"&gt;
  &lt;div class="body"&gt;
    &lt;div class="articleListItem"&gt;
      &lt;h1&gt;&lt;a name="debugging_with_multiple_users"/&gt;Debugging with multiple users&lt;/h1&gt;
      &lt;dl class="head"/&gt;
      &lt;div class="articleMetaData"&gt;
        &lt;div class="location"&gt; Amsterdam, the Netherlands&lt;/div&gt;
        &lt;div class="date"&gt;Thursday, June 11th 2009, 10:47 CEST&lt;/div&gt;
      &lt;/div&gt;
      &lt;p&gt;As author of &lt;a href="http://xdebug.org"&gt;Xdebug&lt;/a&gt;, people ask me often the question how to handle the case in teams when there is one development server and multiple developers working on the same project on that server. Xdebug only allows you to specify &lt;em&gt;one&lt;/em&gt; IP address to connect to (through &lt;a href="http://xdebug.org/docs/remote#remote_host"&gt;xdebug.remote_host&lt;/a&gt; ) while doing &lt;a href="http://xdebug/docs/remote"&gt;remote debugging&lt;/a&gt;. It does not automatically connect back to the IP address that runs the browser the request the PHP scripts because of security reasons. You don't want everybody on the Internet to be able to run a debugging session against your code for example. There is no problem if all developers are working on a different project, because the xdebug.remote_host setting can be made for each directory (through Apache's .htaccess functionality). However, for the case where multiple developers work on the same code, the .htaccess trick won't work as the directory in which the code lives is the same.&lt;/p&gt;
      &lt;img src="http://derickrethans.nl/images/content/xdebug_logo.png" class="left" alt="xdebug_logo.png"/&gt;
      &lt;p&gt;Now, in order to solve the above mentioned issue, you will need to run a DBGp proxy. DBGp is the protocol, designed by &lt;a href="http://activestate.com"&gt;ActiveState&lt;/a&gt; and myself to facilitate communication between an IDE (such as &lt;a href="http://activestate.com/komodo"&gt;Komodo&lt;/a&gt;, or any of the other &lt;a href="http://xdebug.org/docs/remote#clients"&gt;listed clients&lt;/a&gt; ) and PHP+Xdebug. A DBGp proxy is a bit of software that acts as a redirector for DBGp streams. In order to make things work for multiple developers and one source base, you set Xdebug's xdebug.remote_host setting to the machine on which the DBGp proxy runs. This is most likely going to be on the same machine that acts as development server, so that the xdebug.remote_host setting should be set to "127.0.0.1" (i.e. localhost). The proxy server the listens for IDE connections. An IDE needs to register itself with the DBGp proxy by using the &lt;a href="http://xdebug.org/docs-dbgp.php#just-in-time-debugging-and-debugger-proxies"&gt;proxyinit command&lt;/a&gt;. This command requires an "idekey" that is a unique identifier for each client (IDE). Every developer should have its own unique idekey (I usually just pick my name), and this idekey should be configurable in the IDE. For Komodo, it's at Edit-&gt;Preferences-&gt;Debugger-&gt;Connection-&gt;"I am running a debugger proxy and Komodo should use it"-&gt;"Proxy Key". In Komodo you also need to select "a system-provided free port" in the same configuration panel. When initiating the debugging session from the browser with either XDEBUG_SESSION_START=session_name as GET/POST/COOKIE parameter, or export XDEBUG_CONFIG="idekey=session_name" from the comment line, make sure to change "session_name" to the idekey as configured in your IDE. (See &lt;a href="http://xdebug.org/docs/remote#starting"&gt;the documentation&lt;/a&gt; on how to set this up). The Xdebug &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/3960"&gt;Firefox extension&lt;/a&gt; also has a setting for this. You have to configure Xdebug's &lt;a href="http://xdebug.org/docs/remote#remote_host"&gt;xdebug.remote_host&lt;/a&gt; setting to the IP address of the machine that the proxy runs at. Xdebug itself does not see a difference between either the proxy and a normal IDE. But the proxy itself now knows because of the configured idekey on how to forward the requests and responses to the correct client.&lt;/p&gt;
      &lt;p&gt;You can find the DBGp proxy code as part of the &lt;strong&gt;python&lt;/strong&gt; remote debugging package that ActiveState &lt;a href="http://aspn.activestate.com/ASPN/Downloads/Komodo/RemoteDebugging"&gt;provides&lt;/a&gt;. By default it listens for IDE registrations at port 9001, and for Xdebug connections at port 9000. To run the proxy, do:&lt;/p&gt;
      &lt;pre&gt;tar -xvzf Komodo-PythonRemoteDebugging-5.1.3-28369-linux-x86_64.tar.gz
cd Komodo-PythonRemoteDebugging-5.1.3-28369-linux-x86_64
cd bin
./pydbgpproxy

&lt;/pre&gt;
      &lt;p&gt;This outputs:&lt;/p&gt;
      &lt;pre&gt;INFO: dbgp.proxy: starting proxy listeners.  appid: 30430
INFO: dbgp.proxy:     dbgp listener on 127.0.0.1:9000
INFO: dbgp.proxy:     IDE listener on  127.0.0.1:9001

&lt;/pre&gt;
      &lt;p&gt;Running a DBGp proxy also allows you to avoid NAT issues where (as seen from PHP+Xdebug on the server) all connections seem to come from the same IP (because your internal network is NATted). In this case, you can simple run the dbgp proxy on your NAT machine, configure xdebug.remote_host setting to the IP address of your NAT machine, and configure the IDEs to connect to the proxy running at &lt;NAT-machine&gt;:9001.&lt;/p&gt;
      &lt;p&gt;As a last note; there is a patch to allow the connect-back-to-requesting-IP-address functionality that is not available directly in Xdebug. This patch, written by Brian Shire and Lucas Nealan of &lt;a href="http://facebook.com"&gt;Facebook&lt;/a&gt; made its way into Xdebug 2.1. However, great care should be taken by using this functionality. It does not make the NAT situation as outlined above work however.&lt;/p&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</description>
      <guid>200906111047</guid>
      <pubDate>Thu, 11 Jun 2009 08:47:00 +0000</pubDate>
    </item>
    <item>
      <title>php|architect's Guide to Date and Time Programming</title>
      <link>http://derickrethans.nl/phparchitects-guide-to-date-and-time-programming.html</link>
      <description>&lt;div class="article"&gt;
  &lt;div class="body"&gt;
    &lt;div class="articleListItem"&gt;
      &lt;h1&gt;&lt;a name="php_architect_s_guide_to_date_and_time_programming"/&gt;php|architect's Guide to Date and Time Programming&lt;/h1&gt;
      &lt;dl class="head"/&gt;
      &lt;div class="articleMetaData"&gt;
        &lt;div class="location"&gt; Skien, Norway&lt;/div&gt;
        &lt;div class="date"&gt;Wednesday, June 3rd 2009, 21:06 CEST&lt;/div&gt;
      &lt;/div&gt;
      &lt;img src="http://derickrethans.nl/images/content/datebook-cover.jpg" class="left" alt="datebook-cover.jpg"/&gt;
      &lt;p&gt;In the past year I've been working on a book, describing PHP's Date and Time functionality in great detail. It's now finally out under the name " &lt;a href="http://phpdatebook.com"&gt;php|architect's Guide to Date and Time Programming&lt;/a&gt; ". Look at the pretty cover! It's actually a picture I took some months ago from the church in &lt;a href="http://en.wikipedia.org/wiki/Skien"&gt;Skien&lt;/a&gt; , where I am &lt;em&gt;still&lt;/em&gt; living (more about that in a later post).&lt;/p&gt;
      &lt;p&gt;The book is devoted on helping you understanding dates and times, as well as how PHP deals with it. It explains how PHP parsers and reads dates and times in strings including possible pitfalls; timezones, their history, the annoyances and how to deal with them properly; formatting and displaying dates and times; and last but not least, how to handle intervals and iterating over time. There is more information on the &lt;a href="http://phparch.com/c/books/id/9780981034508"&gt;website&lt;/a&gt; where you can also buy this awesome book. And in case you're wondering "what? dates and times are really simple!", then this book is &lt;em&gt;definitely&lt;/em&gt; for you.&lt;/p&gt;
      &lt;p&gt;Rumour is that all attendees of the &lt;a href="http://phpconference.nl"&gt;Dutch PHP Conference&lt;/a&gt; will receive a copy with their tickets, if you're asking nicely I might even sign your copy! I'll be there to give a talk on "PHP on the D-BUS" and will show you how to talk to skype, GSM chips and other desktoppy things!&lt;/p&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</description>
      <guid>200906032106</guid>
      <pubDate>Wed, 03 Jun 2009 19:06:00 +0000</pubDate>
    </item>
    <item>
      <title>pfcongrez, P2P Конференция, php|tek, PHP Vikinger, DPC and eZ Conference and Awards</title>
      <link>http://derickrethans.nl/pfcongrez-p2p-konferenciya-phptek-php-vikinger-dpc-and-ez-conference-and-awards.html</link>
      <description>&lt;div class="article"&gt;
  &lt;div class="body"&gt;
    &lt;div class="articleListItem"&gt;
      &lt;h1&gt;&lt;a name="pfcongrez_p2p_php_tek_php_vikinger_dpc_and_ez_conference_and_awards"/&gt;pfcongrez, P2P Конференция, php|tek, PHP Vikinger, DPC and eZ Conference and Awards&lt;/h1&gt;
      &lt;dl class="head"/&gt;
      &lt;div class="articleMetaData"&gt;
        &lt;div class="location"&gt; London, UK&lt;/div&gt;
        &lt;div class="date"&gt;Friday, April 10th 2009, 01:45 CEST&lt;/div&gt;
      &lt;/div&gt;
      &lt;p&gt;The above mentioned conferences all have one thing in common: I'll be speaking. At the first conference, &lt;a href="http://pfcongrez.nl/"&gt;pfcongrez&lt;/a&gt; I will be talking on implementing Test Driven Development as a model for software development. A modified version of this talk I will also give at the next conference, &lt;a href="http://wtconferences.com"&gt;P2P Конференция&lt;/a&gt; (P2P Conference) in Bulgaria. At this same conference I will be talking on using PHP as development language for GSM based applications on mobile computing platforms running Linux, where I will use the &lt;a href="http://pecl.php.net/dbus"&gt;pecl/dbus&lt;/a&gt; extension to talk to the interface framework available on the &lt;a href="http://openmoko.com"&gt;OpenMoko&lt;/a&gt; platform. This same talk I will also give at &lt;a href="http://phpconference.nl"&gt;DPC&lt;/a&gt; in Amsterdam. In between however I will go to Chicago to speak at &lt;a href="http://tek.mtacon.com"&gt;php|tek&lt;/a&gt; on search technologies in my "Haystacks and Needles" talk and on simple architecture in my KISS talk. Before DPC I will also go to Leuven for &lt;a href="http://phpvikinger.org"&gt;PHP Vikinger&lt;/a&gt; , an unconference that I'll be organizing for the 3rd time. This year it is no longer in Norway, but instead we moved to Leuven in Belgium. It is also de-coupled from the &lt;a href="http://ez.no/company/ez_conference_awards"&gt;eZ Conference and Awards&lt;/a&gt; which will be in Paris.&lt;/p&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</description>
      <guid>200904100145</guid>
      <pubDate>Thu, 09 Apr 2009 23:45:00 +0000</pubDate>
    </item>
    <item>
      <title>PHP Vikinger 2009</title>
      <link>http://derickrethans.nl/php-vikinger-2009.html</link>
      <description>&lt;div class="article"&gt;
  &lt;div class="body"&gt;
    &lt;div class="articleListItem"&gt;
      &lt;h1&gt;&lt;a name="php_vikinger_2009"/&gt;PHP Vikinger 2009&lt;/h1&gt;
      &lt;dl class="head"/&gt;
      &lt;div class="articleMetaData"&gt;
        &lt;div class="location"&gt; London, UK&lt;/div&gt;
        &lt;div class="date"&gt;Monday, April 6th 2009, 12:36 BST&lt;/div&gt;
      &lt;/div&gt;
      &lt;p&gt;I'll be organizing &lt;a href="http://phpvikinger.org"&gt;PHP Vikinger&lt;/a&gt; again this year. It will not be in Norway, but instead we'll be moving to Leuven in Belgium. It will be held on May 30th, very close to Leuven's central station at Café Sport (known from the &lt;a href="http://phpbelgium.be"&gt;PHP Belgium&lt;/a&gt; meetings). For the full invitation, see the &lt;a href="http://phpvikinger.org/news/news-2009-05-06"&gt;website&lt;/a&gt; .&lt;/p&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</description>
      <guid>200904061236</guid>
      <pubDate>Mon, 06 Apr 2009 11:36:00 +0000</pubDate>
    </item>
    <item>
      <title>PHP's two-pass compiler</title>
      <link>http://derickrethans.nl/phps-twopass-compiler.html</link>
      <description>&lt;div class="article"&gt;
  &lt;div class="body"&gt;
    &lt;div class="articleListItem"&gt;
      &lt;h1&gt;&lt;a name="php_s_two-pass_compiler"/&gt;PHP's two-pass compiler&lt;/h1&gt;
      &lt;dl class="head"/&gt;
      &lt;div class="articleMetaData"&gt;
        &lt;div class="location"&gt; Istanbul, Turkey&lt;/div&gt;
        &lt;div class="date"&gt;Saturday, January 24th 2009, 20:55 EET&lt;/div&gt;
      &lt;/div&gt;
      &lt;p&gt;On my way to Istanbul I was looking at Xdebug bug &lt;a href="http://bugs.xdebug.org/view.php?id=422"&gt;#422&lt;/a&gt; . For some reason Xdebug was crashing while doing code-coverage analysis, in the part that analyses which code was dead (ie. opcodes that could never be reached). The crash occurred with a JMPZ (jump-if-zero) instruction, that suddenly saw a jump-to position of 572222864. That position resembles more a jump-address.&lt;/p&gt;
      &lt;p&gt;Xdebug uses the same branch analysis implementation as &lt;a href="http://derickrethans.nl/vld.php"&gt;VLD&lt;/a&gt; so I used the latter tool to find out why it would crash. Unfortunately, it was working just all nice and fine with VLD. After digging around some more, I saw from the back trace that the crash in &lt;a href="http://xdebug.org"&gt;Xdebug&lt;/a&gt; only occurred when a user-defined error-handler was called while parsing a file. The latter gave me the insight of looking at which phase the compiler was in. I remembered that PHP has a two phase compiler. The first pass is quick and dirty, and only records the opcode line &lt;em&gt;number&lt;/em&gt; to jump to. Xdebug however was expecting an &lt;em&gt;memory address&lt;/em&gt; as jump target. Because a memory address is a much larger number than an opcode number—the latter usually not being much higher than a thousand—Xdebug was setting the "visited" flag in a part of memory that wasn't allocated. And writing to unallocated memory makes a process die with a segmentation fault.&lt;/p&gt;
      &lt;p&gt;The compiler in PHP is two-pass. During the first pass, it will find out to which opcode it needs to jump in the jump instructions. However, the PHP engine (and Xdebug) expects a memory address to jump to while &lt;em&gt;executing&lt;/em&gt; your script. In the second pass, the compiler will then go over the generated opcodes and calculate the memory address to jump to from the jumps to opcode numbers. It will also do a few other things, such as collapsing sequential EXT_STMT opcodes, calling Zend extension's functions to finalize the opcode arrays—Xdebug uses this for caching whether an opcode array has been scanned already—and re-allocating the opcode array itself to save space.&lt;/p&gt;
      &lt;p&gt;Now, the thing is, that usually VLD and Xdebug kick in &lt;em&gt;after&lt;/em&gt; the whole opcode array has been created, which includes running the second pass of the compiler. However, Xdebug also tries to analyze opcode arrays while executing them. In the case of a user defined error handler, that happens before the second pass has been run. Preventing the crash was therefore as easy as making sure that the compiler's second pass had been run while scanning the opcode arrays for executable code.&lt;/p&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</description>
      <guid>200901242055</guid>
      <pubDate>Sat, 24 Jan 2009 18:55:00 +0000</pubDate>
    </item>
  </channel>
</rss>

