php check if object implements interface