Title: PHP 7.2 &amp; count()
Last modified: August 17, 2018

---

# PHP 7.2 & count()

 *  [cjhaas](https://wordpress.org/support/users/chrisvendiadvertisingcom/)
 * (@chrisvendiadvertisingcom)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/php-7-2-count/)
 * On line 248 of `/admin/class-equal-height-columns-admin.php` the code below will
   break under PHP 7.2 if the value passed to `count` isn’t countable.
 * `$field_count = count( $this->options[ $this->options_group_slug ] ) ? count(
   $this->options[ $this->options_group_slug ] ) : 1;`
 * It should instead also include a call to `is_countable()`
 * `$field_count = is_countable( $this->options[ $this->options_group_slug ] ) &&
   count( $this->options[ $this->options_group_slug ] ) ? count( $this->options[
   $this->options_group_slug ] ) : 1;`
 * Unfortunately `is_countable()` won’t be added until PHP 7.3 but there’s a really
   simple polyfill available:
    [https://github.com/Ayesh/is_countable-polyfill/blob/master/src/is_countable.php](https://github.com/Ayesh/is_countable-polyfill/blob/master/src/is_countable.php)

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

 *  [Greg Marshall](https://wordpress.org/support/users/timeassistant/)
 * (@timeassistant)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/php-7-2-count/#post-10876436)
 * I just upgraded multiple WP sites from PHP 7.0 and 7.1 to 7.2 and my server logs
   are now filling up with this issue too from the sites using this plugin
 * `PHP Warning: count(): Parameter must be an array or an object that implements
   Countable in /wp-content/plugins/equal-height-columns/admin/class-equal-height-
   columns-admin.php on line 248`
 *  [bjornwebdesign](https://wordpress.org/support/users/bjornwebdesign/)
 * (@bjornwebdesign)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/php-7-2-count/#post-11081070)
 * [@chrisvendiadvertisingcom](https://wordpress.org/support/users/chrisvendiadvertisingcom/)
 * Thank you for the fix, I just updated to PHP 7.3.
 * I guess the plugin is abandoned 🙁
 * Not sure if there’s an alternative?
    Maybe someone is interested to take over
   this one.
 *  [FortMaxWave](https://wordpress.org/support/users/knightwave/)
 * (@knightwave)
 * [7 years ago](https://wordpress.org/support/topic/php-7-2-count/#post-11580530)
 * Same problem here with PHP 7.2 🙁
 *  [FortMaxWave](https://wordpress.org/support/users/knightwave/)
 * (@knightwave)
 * [7 years ago](https://wordpress.org/support/topic/php-7-2-count/#post-11585698)
 * [@chrisvendiadvertisingcom](https://wordpress.org/support/users/chrisvendiadvertisingcom/)
 * Can you tell me how to use the polyfill?
 * Thanks

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

The topic ‘PHP 7.2 & count()’ is closed to new replies.

 * ![](https://ps.w.org/equal-height-columns/assets/icon-128x128.png?rev=1114939)
 * [Equal Height Columns](https://wordpress.org/plugins/equal-height-columns/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/equal-height-columns/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/equal-height-columns/)
 * [Active Topics](https://wordpress.org/support/plugin/equal-height-columns/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/equal-height-columns/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/equal-height-columns/reviews/)

 * 4 replies
 * 4 participants
 * Last reply from: [FortMaxWave](https://wordpress.org/support/users/knightwave/)
 * Last activity: [7 years ago](https://wordpress.org/support/topic/php-7-2-count/#post-11585698)
 * Status: not resolved