improved PHP 4.x compatibility