The same problem using Wamp server, version 1.7.3 - not the PHP, because my PHP version is 5.2.4
The bug caused by this line:
$dom = new DOMDocument( '1.0', 'iso-8859-1' );
outputs: "Warning: domdocument::domdocument() expects parameter 2 to be long, string given in..."
But, testing the same script using my server on Ubuntu 7.10, no bug ocurred.
Why? i don't know. Searching all references in Google, NOBODY knows the solution.
The solution is: install another server, or download the PHP and Apache separated and install one by one...