migrating a PHP4 codebase to PHP5