php client implementation