improved PHP 5.3 compatibility --- obviously not ready yet