Fix memberOf detection. Fixes: #9835

Proposed change.
Please update the method's PHP doc about the return  value.