Make some PHP code compatible with PHP 5.3