Title: PHP error
Last modified: January 12, 2020

---

# PHP error

 *  Resolved [SpartakusMd](https://wordpress.org/support/users/spartakusmd/)
 * (@spartakusmd)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/php-error-359/)
 * Hello,
 * It seems there is an issue. When a user doesn’t complete a lesson quiz, this 
   error from bellow shows up. But when a user completes the lesson quiz, this error
   does NOT appear.
 * `Warning: count(): Parameter must be an array or an object that implements Countable
   in wp-content/plugins/woothemes-sensei/plugins/sensei-lms/includes/class-sensei-
   question.php on line 1075.`
 * Strange fact is that count() is used and inside that if, there is an is_array()
   check on that same field.
 * Please revise the checks.
    -  This topic was modified 6 years, 5 months ago by [SpartakusMd](https://wordpress.org/support/users/spartakusmd/).

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

 *  [Giannis](https://wordpress.org/support/users/gikaragia/)
 * (@gikaragia)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/php-error-359/#post-12331504)
 * Hello [@spartakusmd](https://wordpress.org/support/users/spartakusmd/),
 * thank you for submitting this. PHP’s [count function](https://www.php.net/manual/en/function.count.php)
   throws a warning when you supply it a non-countable variable in version 7.2 and
   afterwards. However it will still return 1 (unless the input is NULL). So in 
   pre-7.2 PHP it would make sense to write something like that and then check if
   the variable is an actual array.
 * In any case we will look into refactoring this to not throw a warning.
 * Thanks,
    Giannis
    -  This reply was modified 6 years, 4 months ago by [Giannis](https://wordpress.org/support/users/gikaragia/).
 *  Plugin Author [Donna Peplinskie (a11n)](https://wordpress.org/support/users/donnapep/)
 * (@donnapep)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/php-error-359/#post-12361758)
 * Marking as resolved as this was fixed in Sensei LMS 2.4.0.

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

The topic ‘PHP error’ is closed to new replies.

 * ![](https://ps.w.org/sensei-lms/assets/icon-128x128.gif?rev=2914239)
 * [Sensei LMS - Online Courses, Quizzes, & Learning](https://wordpress.org/plugins/sensei-lms/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/sensei-lms/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/sensei-lms/)
 * [Active Topics](https://wordpress.org/support/plugin/sensei-lms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sensei-lms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sensei-lms/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [Donna Peplinskie (a11n)](https://wordpress.org/support/users/donnapep/)
 * Last activity: [6 years, 4 months ago](https://wordpress.org/support/topic/php-error-359/#post-12361758)
 * Status: resolved