• Hello
    wondering whether anybody else is getting this error and how to fix this:

    Warning: count(): Parameter must be an array or an object that implements Countable in /Users/Name/Sites/localhost/sites/site-1/wp-includes/formatting.php on line 3903

    Thank you in advance for your input.

Viewing 7 replies - 1 through 7 (of 7 total)
  • According to line number count function is being used in wp_trim_words function. so that function is being called somewhere in your theme or in any plugin that might pass NULL instead of a string. You’ll have to trace the error in the log file.

    • This reply was modified 4 years, 4 months ago by Vijay Hardaha.
    Thread Starter mmjaeger

    (@mmjaeger)

    it seems that when downgrading from PHP 8 to PHP 7 the issue goes away??

    Dion

    (@diondesigns)

    THat means your theme or one of your plugins isn’t compatible with PHP 8. You should locate your PHP error log; it will contain a detailed listing of the error, and that should tell you which theme/plugin is the culprit.

    Thread Starter mmjaeger

    (@mmjaeger)

    I’ll check it – thank you

    Thread Starter mmjaeger

    (@mmjaeger)

    is there a way to get more detail in the log file – I’m only getting this:

    [09-Jan-2022 00:05:16 UTC] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /Users/Marco/Sites/localhost/sites/mmjaeger.com/wp-includes/formatting.php on line 3903
    [09-Jan-2022 00:05:16 UTC] PHP Warning: implode(): Invalid arguments passed in /Users/Marco/Sites/localhost/sites/mmjaeger.com/wp-includes/formatting.php on line 3908

    Try the Query monitor plugin it might show more details on errors.

    Thread Starter mmjaeger

    (@mmjaeger)

    Thanks

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

The topic ‘wp-includes/formatting.php on line 3908 error’ is closed to new replies.