Fixed to work with versions of PHP earlier than 4.3 (theoretically ... I don't yet have a 4.2 test environment).