Title: Uncaught TypeError (PHP 8 issue?)
Last modified: November 30, 2020

---

# Uncaught TypeError (PHP 8 issue?)

 *  Resolved [quppa](https://wordpress.org/support/users/quppa/)
 * (@quppa)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/uncaught-typeerror-php-8-issue/)
 * I’m getting the following error when trying to activate version 2.8.15 of this
   plugin with WordPress 5.6 (RC1) and PHP 8.0.0:
 *     ```
       Fatal error:  Uncaught TypeError: count(): Argument #1 ($var) must be of type Countable|array, string given in /var/www/html/blog/wp-content/plugins/urvanov-syntax-highlighter/util/class-urvanov-syntax-highlighter-util.php:663
       Stack trace:
       #0 /var/www/html/blog/wp-content/plugins/urvanov-syntax-highlighter/util/class-urvanov-syntax-highlighter-util.php(672): UrvanovSyntaxHighlighterUtil::version_parts()
       #1 /var/www/html/blog/wp-content/plugins/urvanov-syntax-highlighter/class-urvanov-syntax-highlighter-plugin.php(1134): UrvanovSyntaxHighlighterUtil::version_compare()
       #2 /var/www/html/blog/wp-content/plugins/urvanov-syntax-highlighter/class-urvanov-syntax-highlighter-plugin.php(1326): Urvanov_Syntax_Highlighter_Plugin::update()
       #3 /var/www/html/blog/wp-admin/includes/plugin.php(2299): include('...')
       #4 /var/www/html/blog/wp-admin/plugins.php(191): plugin_sandbox_scrape()
       #5 {main}
         thrown in /var/www/html/blog/wp-content/plugins/urvanov-syntax-highlighter/util/class-urvanov-syntax-highlighter-util.php on line 663
       ```
   
 * I don’t see anything in the PHP 8 breaking changes list, but I wonder if they
   switched this warning to an error: [https://wiki.php.net/rfc/counting_non_countables](https://wiki.php.net/rfc/counting_non_countables)

Viewing 15 replies - 1 through 15 (of 21 total)

1 [2](https://wordpress.org/support/topic/uncaught-typeerror-php-8-issue/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/uncaught-typeerror-php-8-issue/page/2/?output_format=md)

 *  Plugin Author [urvanov](https://wordpress.org/support/users/urvanov/)
 * (@urvanov)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/uncaught-typeerror-php-8-issue/#post-13727663)
 * Strange error. I did not test the plugin in PHP 8 yet.
 * Looks that you are right, they changed the behaviour. I cannot fix and make the
   update right now. But I will try to do something on the weekend.
 *  Plugin Author [urvanov](https://wordpress.org/support/users/urvanov/)
 * (@urvanov)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/uncaught-typeerror-php-8-issue/#post-13751080)
 * I tried it but I couldn’t start a fresh copy of WordPress with PHP 8. Maybe it
   is too early.
 *  Thread Starter [quppa](https://wordpress.org/support/users/quppa/)
 * (@quppa)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/uncaught-typeerror-php-8-issue/#post-13752514)
 * I had some issues running WordPress 5.5, but pre-release WordPress 5.6 seems 
   to be working fine.
 *  Plugin Author [urvanov](https://wordpress.org/support/users/urvanov/)
 * (@urvanov)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/uncaught-typeerror-php-8-issue/#post-13834704)
 * [@quppa](https://wordpress.org/support/users/quppa/) I have installed PHP 8 and
   wordpress 5.6 with the plugin. But I don’t see the errors. Maybe there some other
   conditions?
    -  This reply was modified 5 years, 5 months ago by [urvanov](https://wordpress.org/support/users/urvanov/).
 *  [worldsdream](https://wordpress.org/support/users/worldsdream/)
 * (@worldsdream)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/uncaught-typeerror-php-8-issue/#post-13835513)
 * As [@quppa](https://wordpress.org/support/users/quppa/) mentioned, problems were
   with WP 5.5 and not 5.6.
 * I guess you can mark this as solved because everyone needs to update to the latest
   version.
 * Thank you [@quppa](https://wordpress.org/support/users/quppa/) for letting [@urvanov](https://wordpress.org/support/users/urvanov/)
   know.
 *  Thread Starter [quppa](https://wordpress.org/support/users/quppa/)
 * (@quppa)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/uncaught-typeerror-php-8-issue/#post-13835717)
 * I’m afraid I’m getting the same error with 2.8.16.
 *  [Beherit](https://wordpress.org/support/users/beherit/)
 * (@beherit)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/uncaught-typeerror-php-8-issue/#post-13835949)
 * Same problem for me but it appeared after the update updating from 2.8.15 to 
   2.8.16, now even downgrading doesen’t help :/
 *  [Beherit](https://wordpress.org/support/users/beherit/)
 * (@beherit)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/uncaught-typeerror-php-8-issue/#post-13835987)
 * [@urvanov](https://wordpress.org/support/users/urvanov/) You should use this 
   function to prevent this error: [https://www.php.net/manual/en/function.is-countable.php](https://www.php.net/manual/en/function.is-countable.php)
 *  [Beherit](https://wordpress.org/support/users/beherit/)
 * (@beherit)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/uncaught-typeerror-php-8-issue/#post-13839522)
 * Problem still exists on version 2.8.17.
 *  [Beherit](https://wordpress.org/support/users/beherit/)
 * (@beherit)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/uncaught-typeerror-php-8-issue/#post-13839558)
 * Maybe just use version_compare function from PHP instead of your own function?
 *  Plugin Author [urvanov](https://wordpress.org/support/users/urvanov/)
 * (@urvanov)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/uncaught-typeerror-php-8-issue/#post-13850728)
 * I don’t understand why I don’t see the error. What is the difference between 
   your PHP and mine?
 *  Plugin Author [urvanov](https://wordpress.org/support/users/urvanov/)
 * (@urvanov)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/uncaught-typeerror-php-8-issue/#post-13850729)
 * Maybe some minor version difference
 *  Plugin Author [urvanov](https://wordpress.org/support/users/urvanov/)
 * (@urvanov)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/uncaught-typeerror-php-8-issue/#post-13857783)
 * [@beherit](https://wordpress.org/support/users/beherit/) , [@quppa](https://wordpress.org/support/users/quppa/)
   Tell please. Do you use the version from wordpress plugin repository or from 
   github sources repository?
 *  [Beherit](https://wordpress.org/support/users/beherit/)
 * (@beherit)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/uncaught-typeerror-php-8-issue/#post-13857799)
 * [@urvanov](https://wordpress.org/support/users/urvanov/) I use version form wordpress
   plugin repository. Problem still exists, I can’t even go to site admin page :/
 * `Fatal error: Uncaught TypeError: count(): Argument #1 ($var) must be of type
   Countable|array, string given in /.../public_html/wp-content/plugins/urvanov-
   syntax-highlighter/util/class-urvanov-syntax-highlighter-util.php:664 Stack trace:#
   0 /.../public_html/wp-content/plugins/urvanov-syntax-highlighter/util/class-urvanov-
   syntax-highlighter-util.php(673): UrvanovSyntaxHighlighterUtil::version_parts()#
   1 /.../public_html/wp-content/plugins/urvanov-syntax-highlighter/class-urvanov-
   syntax-highlighter-plugin.php(1134): UrvanovSyntaxHighlighterUtil::version_compare()#
   2 /.../public_html/wp-content/plugins/urvanov-syntax-highlighter/class-urvanov-
   syntax-highlighter-plugin.php(1326): Urvanov_Syntax_Highlighter_Plugin::update()#
   3 /.../public_html/wp-settings.php(388): include_once('...') #4 /.../public_html/
   wp-config.php(94): require_once('...') #5 /.../public_html/wp-load.php(37): require_once('...')#
   6 /.../public_html/wp-admin/admin.php(34): require_once('...') #7 /.../public_html/
   wp-admin/index.php(10): require_once('...') #8 {main} thrown in /.../public_html/
   wp-content/plugins/urvanov-syntax-highlighter/util/class-urvanov-syntax-highlighter-
   util.php on line 664`
 *  [Beherit](https://wordpress.org/support/users/beherit/)
 * (@beherit)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/uncaught-typeerror-php-8-issue/#post-13857808)
 * Version form github have this same problem.

Viewing 15 replies - 1 through 15 (of 21 total)

1 [2](https://wordpress.org/support/topic/uncaught-typeerror-php-8-issue/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/uncaught-typeerror-php-8-issue/page/2/?output_format=md)

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

 * ![](https://s.w.org/plugins/geopattern-icon/urvanov-syntax-highlighter.svg)
 * [Urvanov Syntax Highlighter](https://wordpress.org/plugins/urvanov-syntax-highlighter/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/urvanov-syntax-highlighter/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/urvanov-syntax-highlighter/)
 * [Active Topics](https://wordpress.org/support/plugin/urvanov-syntax-highlighter/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/urvanov-syntax-highlighter/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/urvanov-syntax-highlighter/reviews/)

 * 21 replies
 * 4 participants
 * Last reply from: [urvanov](https://wordpress.org/support/users/urvanov/)
 * Last activity: [5 years, 5 months ago](https://wordpress.org/support/topic/uncaught-typeerror-php-8-issue/page/2/#post-13858402)
 * Status: resolved