Title: PHP Warning: count()
Last modified: August 4, 2020

---

# PHP Warning: count()

 *  [koolpal](https://wordpress.org/support/users/koolpal/)
 * (@koolpal)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/php-warning-count-7/)
 * Hi,
 * With debug enabled I am seeing the below PHP Warning
    `[04-Aug-2020 10:00:54 
   UTC] PHP Warning: count(): Parameter must be an array or an object that implements
   Countable in path\wp-content\plugins\image-sizes\templates\settings\disable-sizes.
   php on line 5`
 * Please fix.
 * Thanks

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

 *  [delaitec](https://wordpress.org/support/users/delaitec/)
 * (@delaitec)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/php-warning-count-7/#post-13224220)
 * Same Here:
 * `[07-Aug-2020 20:52:47 UTC] PHP Warning: count(): Parameter must be an array 
   or an object that implements Countable in /home2/delaio86/public_html/loja.delaitec.
   com/site/wp-content/plugins/image-sizes/templates/settings/disable-sizes.php 
   on line 5`
 *  [delaitec](https://wordpress.org/support/users/delaitec/)
 * (@delaitec)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/php-warning-count-7/#post-13224385)
 * Hello.
 * I found a possible solution on the internet and adapted it to our case.
    The 
   errors disappeared.
 * The explanation of the solution is in the link below:
    [https://www.gigasystems.com.br/artigo/106/error-php-7-2-count-parameter-must-be-an-array-or-an-object-that-implements-countable](https://www.gigasystems.com.br/artigo/106/error-php-7-2-count-parameter-must-be-an-array-or-an-object-that-implements-countable)
 * **The solution I did follows here:**
    If you are receiving the error:
 * > PHP Warning: count (): Parameter must be an array or an object that implements
   > Countable in … / wp-content / plugins / image-sizes / templates / settings /
   > disable-sizes.php on line 5
 * Access the file:
 * > /wp-content/plugins/image-sizes/templates/settings/disable-sizes.php
 * Replace this code:
    `count( get_option( '_image-sizes' ) )`
 * Per:
    `$pkCount = ( is_array(get_option('_image-sizes')) ? count(get_option('
   _image-sizes')) : 0 ), $pkCount`
 * I don’t know yet if this could cause a problem in the future, because I just 
   created the solution.
 * The developer will be able to tell us better. let’s wait.
    -  This reply was modified 5 years, 9 months ago by [delaitec](https://wordpress.org/support/users/delaitec/).
    -  This reply was modified 5 years, 9 months ago by [delaitec](https://wordpress.org/support/users/delaitec/).

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

The topic ‘PHP Warning: count()’ is closed to new replies.

 * ![](https://ps.w.org/image-sizes/assets/icon-256x256.png?rev=3525032)
 * [ThumbPress – Compress Images, Manage Thumbnails, Detect Image Issues, WebP/AVIF, Lazy Loading, Hotlinking & More](https://wordpress.org/plugins/image-sizes/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/image-sizes/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/image-sizes/)
 * [Active Topics](https://wordpress.org/support/plugin/image-sizes/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/image-sizes/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/image-sizes/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [delaitec](https://wordpress.org/support/users/delaitec/)
 * Last activity: [5 years, 9 months ago](https://wordpress.org/support/topic/php-warning-count-7/#post-13224385)
 * Status: not resolved