Title: WPtouch incompatible with PHP 8.1
Last modified: September 14, 2022

---

# WPtouch incompatible with PHP 8.1

 *  Resolved [Sara Patricia](https://wordpress.org/support/users/sarapatricia/)
 * (@sarapatricia)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/wptouch-incompatible-with-php-8-1/)
 * After upgrading to PHP 8.1 I can no longer access the WPtouch settings page ./
   wp-admin/admin.php?page=wptouch-admin-general-settings and this E_ERROR is thrown:
 *     ```
       Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /wordpress/wp-content/plugins/wptouch/core/class-array-iterator.php:12
       Stack trace:
       #0 /wordpress/wp-content/plugins/wptouch/core/admin-custom-icons.php(18): WPtouchArrayIterator->__construct(NULL)
       #1 /wordpress/wp-content/plugins/wptouch/admin/settings/html/custom_icon_management.php(2): wptouch_have_custom_icons()
       #2 /wordpress/wp-content/plugins/wptouch/core/admin-load.php(224): include('/homepages/34/d...')
       #3 /wordpress/wp-content/plugins/wptouch/core/admin-load.php(180): wptouch_admin_render_special_setting(Object(stdClass))
       #4 /wordpress/wp-content/plugins/wptouch/core/admin-render.php(171): wptouch_admin_render_setting(Object(stdClass))
       #5 /wordpress/wp-content/plugins/wptouch/core/admin-load.php(173): include('/homepages/34/d...')
       #6 /wordpress/wp-includes/class-wp-hook.php(307): wptouch_admin_render_menu('')
       #7 /wordpress/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters('', Array)
       #8 /wordpress/wp-includes/plugin.php(476): WP_Hook->do_action(Array)
       #9 /wordpress/wp-admin/admin.php(259): do_action('toplevel_page_w...')
       #10 {main}
         thrown
       ```
   
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fwptouch-incompatible-with-php-8-1%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  [boboyu](https://wordpress.org/support/users/boboyu/)
 * (@boboyu)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/wptouch-incompatible-with-php-8-1/#post-16037910)
 * I also met this problem and i modified the file `wptouch/core/class-array-iterator.
   php` line 12 to `$this->count = is_countable($a) ? count( $a ) : 0;`, then work
   well. You can have a try.
 * PS: Don’t upgrade wordpress to 6.0, there are also something incompatible.
 *  Thread Starter [Sara Patricia](https://wordpress.org/support/users/sarapatricia/)
 * (@sarapatricia)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/wptouch-incompatible-with-php-8-1/#post-16039762)
 * Thanks – that did the trick.
 * Not sure what you mean with
 * > Don’t upgrade wordpress to 6.0, there are also something incompatible.
 * It seems to work ok for me with WordPress 6.0.2. In case you refer to [https://wordpress.org/support/topic/http_user_agent-error/](https://wordpress.org/support/topic/http_user_agent-error/)
   that’s just a warning.
 *  Thread Starter [Sara Patricia](https://wordpress.org/support/users/sarapatricia/)
 * (@sarapatricia)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/wptouch-incompatible-with-php-8-1/#post-16289513)
 * I just upgraded WPtouch to version 4.3.42 hoping that this issue got finally 
   fixed, but unfortunately it wasn’t and I had to apply [@boboyu](https://wordpress.org/support/users/boboyu/)’
   s fix manually once more.
 * I really wonder why this issue was set to “resolved”.

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

The topic ‘WPtouch incompatible with PHP 8.1’ is closed to new replies.

 * ![](https://ps.w.org/wptouch/assets/icon-256x256.png?rev=1313960)
 * [WPtouch - Make your WordPress Website Mobile-Friendly](https://wordpress.org/plugins/wptouch/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wptouch/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wptouch/)
 * [Active Topics](https://wordpress.org/support/plugin/wptouch/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wptouch/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wptouch/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Sara Patricia](https://wordpress.org/support/users/sarapatricia/)
 * Last activity: [3 years, 8 months ago](https://wordpress.org/support/topic/wptouch-incompatible-with-php-8-1/#post-16289513)
 * Status: resolved