php check object implements interface