Fix for function not present in PHP 5.3