Attempt to allow PHP 5.4 or 5.2 (unfortunately required) compatibility for this function