fix test errors in PHP 5.4