PHP implementation of retry-handler.