I am totally new to PHP and found that it wouldn't run at first on my hosting company's server (which is running PHP 5). I found that I needed to change the line
require_once('icestats.php');
in the example page to
include 'icestats.php';
Otherwise I got a 'class declared twice' error or something like that.
Also for those people like me who don't have a clue how to extract individual fields from the returned object, after a bit of trial and error (!) it turns out you can do it like this:
For example, to print the current artist:
echo $stats->artist[0];
Basically change 'artist' above for whatever other field your are interested in..