Title: PHP71 Compatibility
Last modified: September 25, 2017

---

# PHP71 Compatibility

 *  [pakpenyo](https://wordpress.org/support/users/pakpenyo/)
 * (@pakpenyo)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/php71-compatibility/)
 * Hi,
 * I’ve got some error with php71 (7.1.8).
 * `Fatal error: Uncaught Error: [] operator not supported for strings in /Users/
   penyo/Sites/domain.dev/wp-content/themes/v8/lib/mobble.php:261 Stack trace: #
   0 /Users/penyo/Sites/domain.dev/wp-content/themes/v8/lib/mobble.php(191): mobble_body_class('')#
   1 /Users/penyo/Sites/domain.dev/wp-content/themes/v8/base.php(14): mobble_class()#
   2 /Users/penyo/Sites/domain.dev/wp-includes/template-loader.php(74): include('/
   Users/penyo/Si...') #3 /Users/penyo/Sites/domain.dev/wp-blog-header.php(19): 
   require_once('/Users/penyo/Si...') #4 /Users/penyo/Sites/domain.dev/index.php(
   17): require('/Users/penyo/Si...') #5 {main} thrown in /Users/penyo/Sites/domain.
   dev/wp-content/themes/v8/lib/mobble.php on line 261`
 * Thanks.

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

 *  Thread Starter [pakpenyo](https://wordpress.org/support/users/pakpenyo/)
 * (@pakpenyo)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/php71-compatibility/#post-9530126)
 * Fixed. Add
 * `$classes = array();`
 * at the line:
 *     ```
       	// bonus
       	if ( ! is_handheld() ) {
       		$classes = array();
       		$classes[] = 'desktop';
       	}
       ```
   
 *  Plugin Author [Scott (@scottsweb)](https://wordpress.org/support/users/scottsweb/)
 * (@scottsweb)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/php71-compatibility/#post-9563670)
 * I am not sure about this one. `$classes` should be an array long before then.
   It gets passed in here: [https://github.com/scottsweb/mobble/blob/master/mobble.php#L437](https://github.com/scottsweb/mobble/blob/master/mobble.php#L437)
   from the filter. It seems odd setting it later on does the trick. This would 
   also destroy any existing classes.
 *  Thread Starter [pakpenyo](https://wordpress.org/support/users/pakpenyo/)
 * (@pakpenyo)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/php71-compatibility/#post-9589821)
 * Now i’m using with :
 *     ```
       global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_edge, $mobble_detect;
       $classes = array();
       ```
   
 * I’m using mobble with html class, not body class.

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

The topic ‘PHP71 Compatibility’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/mobble_f5f5f5.svg)
 * [mobble](https://wordpress.org/plugins/mobble/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mobble/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mobble/)
 * [Active Topics](https://wordpress.org/support/plugin/mobble/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mobble/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mobble/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [pakpenyo](https://wordpress.org/support/users/pakpenyo/)
 * Last activity: [8 years, 7 months ago](https://wordpress.org/support/topic/php71-compatibility/#post-9589821)
 * Status: not resolved