php check if variable implements interface