Title: Undefined offset: 0
Last modified: August 22, 2016

---

# Undefined offset: 0

 *  Resolved [signo](https://wordpress.org/support/users/signo/)
 * (@signo)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/undefined-offset-0-1/)
 * When DEBUG is turned on i get error Undefined offset: 0 at line 655 of file user-
   switching.php
 *     ```
       if ( ( 'switch_to_user' === $cap ) and ( $args[0] == $user_id ) ) {
       			$required_caps[] = 'do_not_allow';
       }
       ```
   
 * If you add a test for empty at line 655 the error goes away
 *     ```
       if ( ( 'switch_to_user' === $cap ) and ( !empty( $args ) && $args[0] == $user_id ) ) {
       			$required_caps[] = 'do_not_allow';
       }
       ```
   
 * [https://wordpress.org/plugins/ultimate-member/](https://wordpress.org/plugins/ultimate-member/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Ultimate Member](https://wordpress.org/support/users/ultimatemember/)
 * (@ultimatemember)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/undefined-offset-0-1/#post-5867692)
 * Where is that file is loaded from? user-switching.php? because it is not part
   of Ultimate Member plugin. 🙂
 * Hope to get a reply from you on this.
 * Thanks!
 *  Thread Starter [signo](https://wordpress.org/support/users/signo/)
 * (@signo)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/undefined-offset-0-1/#post-5867693)
 * Ooops sorry, i clicked the wrong browser tab to report the error. man i have 
   to stop keeping so many tabs open, this error is for the user-switching plugin.
   Again sorry for reporting the error in the wrong forum.
 *  Plugin Author [Ultimate Member](https://wordpress.org/support/users/ultimatemember/)
 * (@ultimatemember)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/undefined-offset-0-1/#post-5867698)
 * No need to be sorry, thanks for getting back to me on this topic 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Undefined offset: 0’ is closed to new replies.

 * ![](https://ps.w.org/ultimate-member/assets/icon-256x256.png?rev=3160947)
 * [Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin](https://wordpress.org/plugins/ultimate-member/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ultimate-member/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ultimate-member/)
 * [Active Topics](https://wordpress.org/support/plugin/ultimate-member/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ultimate-member/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ultimate-member/reviews/)

## Tags

 * [E_NOTICE](https://wordpress.org/support/topic-tag/e_notice/)

 * 3 replies
 * 2 participants
 * Last reply from: [Ultimate Member](https://wordpress.org/support/users/ultimatemember/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/undefined-offset-0-1/#post-5867698)
 * Status: resolved