I'm not familiar with the wurfl_class(), but the other PHP looks OK.
The best way to debug/troubleshoot PHP is to open a shell window (Terminal, PuTTy, or whatever you have), SSH into the server (or localhost if you're testing locally), find your PHP error logs - they are often at /usr/local/apache/logs/ .
do this command:
#> tail -f error_log
where "error_log" is the name of the log file. Sometimes it's named something else.
Run your code, and see if any errors pop up. They'll be descriptive enough that you can diagnose any problems that are happening in the script.