Title: PHP Warnings: Count ()
Last modified: March 30, 2021

---

# PHP Warnings: Count ()

 *  [daf57](https://wordpress.org/support/users/daf57/)
 * (@daf57)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/php-warnings-count/)
 * Wordpress 5.7 – Hueman Free 3.7.6
    Getting the following errors:
 *     ```
       [30-Mar-2021 13:17:42 UTC] PHP Warning:  count(): Parameter must be an array or an object that implements Countable in /home/youtellmetexas/public_html/wp-content/themes/hueman/comments.php on line 10
       [30-Mar-2021 13:17:42 UTC] PHP Warning:  count(): Parameter must be an array or an object that implements Countable in /home/youtellmetexas/public_html/wp-content/themes/hueman/comments.php on line 11
       ```
   
 * The lines in question are:
 *     ```
       <li class="active"><a href="#commentlist-container"><i class="far fa-comments"></i><?php _e( 'Comments', 'hueman' ); ?><span><?php echo count($wp_query->comments_by_type['comment']); ?></span></a></li>
       			<li><a href="#pinglist-container"><i class="fas fa-share"></i><?php _e( 'Pingbacks', 'hueman' ); ?><span><?php echo count($wp_query->comments_by_type['pings']); ?></span></a></li>
       ```
   
 * There are issues with count() in the newer versions of PHP. The release notes
   for the 3.7x say the code is PHP 8 friendly. This is apparently not the case 
   here. Please advise as to how to modify the comments.php file to avoid the warnings.
   
   Thanks!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fphp-warnings-count%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Thread Starter [daf57](https://wordpress.org/support/users/daf57/)
 * (@daf57)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/php-warnings-count/#post-14255347)
 * Forgot mention that my PHP version is 7.2
 * Thanks!

Viewing 1 replies (of 1 total)

The topic ‘PHP Warnings: Count ()’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/hueman/3.7.27/screenshot.png)
 * Hueman
 * [Support Threads](https://wordpress.org/support/theme/hueman/)
 * [Active Topics](https://wordpress.org/support/theme/hueman/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/hueman/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/hueman/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [daf57](https://wordpress.org/support/users/daf57/)
 * Last activity: [5 years, 1 month ago](https://wordpress.org/support/topic/php-warnings-count/#post-14255347)
 * Status: not resolved