Title: PHP 8: Uncaught TypeError: count()
Last modified: April 12, 2023

---

# PHP 8: Uncaught TypeError: count()

 *  Resolved [Marc_J](https://wordpress.org/support/users/marc_j/)
 * (@marc_j)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/php-8-uncaught-typeerror-count/)
 * Hi there,
 * it seems you aren’t checking for $review_criteria being an array here:
 *     ```wp-block-code
       /wp-content/plugins/reviewx/partials/storefront/myaccount/add-review.php:197
       ```
   
 * You did so in line 52. I guess something like the following could work to fix
   this error:
 *     ```wp-block-code
       <input type="hidden" name="rx-total-criteria" id="rx-total-criteria" value="<?php echo ( is_array( $review_criteria ) ) ? count( $review_criteria ) : 0; ?>">
       ```
   
 * Since PHP 8 count() throws a TypeError. For us it’s breaking the order page in
   my account (WooCommerce).
 * Best,
   Marc

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

 *  Plugin Contributor [Sabbir Mahmud](https://wordpress.org/support/users/sadhinsabbir/)
 * (@sadhinsabbir)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/php-8-uncaught-typeerror-count/#post-16650631)
 * Hi [@marc_j](https://wordpress.org/support/users/marc_j/) !
   Hope you’re doing
   great!Thanks for bringing the issue front. We have already started working on
   it and hopefully, it will be resolved really soon. In the meantime, if you need
   help with anything else, feel free to contact our dedicated [support](https://reviewx.io/support/).
   Kind regards
 *  Plugin Contributor [Sabbir Mahmud](https://wordpress.org/support/users/sadhinsabbir/)
 * (@sadhinsabbir)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/php-8-uncaught-typeerror-count/#post-16658814)
 * Dear [@marc_j](https://wordpress.org/support/users/marc_j/) !
   The issue has been
   addressed successfully and we will release an update soon. In the meantime, if
   you need help with anything else, feel free to contact our dedicated [support](https://reviewx.io/support/).
   Kind regards

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

The topic ‘PHP 8: Uncaught TypeError: count()’ is closed to new replies.

 * ![](https://ps.w.org/reviewx/assets/icon-256x256.gif?rev=2365574)
 * [ReviewX – Multi-Criteria Reviews for WooCommerce with Google Reviews & Schema](https://wordpress.org/plugins/reviewx/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/reviewx/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/reviewx/)
 * [Active Topics](https://wordpress.org/support/plugin/reviewx/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/reviewx/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/reviewx/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Sabbir Mahmud](https://wordpress.org/support/users/sadhinsabbir/)
 * Last activity: [3 years, 1 month ago](https://wordpress.org/support/topic/php-8-uncaught-typeerror-count/#post-16658814)
 * Status: resolved