Title: PHP Fatal Error &#8211; Trim
Last modified: October 22, 2023

---

# PHP Fatal Error – Trim

 *  Resolved [jahrat](https://wordpress.org/support/users/jahrat/)
 * (@jahrat)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/php-fatal-error-trim/)
 * Hello support,
 * I have a constant error in my logs for the below:
   **_PHP Fatal error: Uncaught
   TypeError: ltrim(): Argument #1 ($string) must be of type string, array given
   in /…/wp-includes/formatting.php:4477thrown in /…/wp-includes/formatting.php 
   on line 4477_
 * Using Query Monitor to try to trace this the only reference I can find is:
   **
   _trim(): Passing null to parameter #1 ($string) of type string is deprecated_**
 * With the paths:
   **_wp-content/plugins/the-events-calendar/common/vendor/vendor-
   prefixed/stellarwp/db/src/DB/QueryBuilder/Clauses/From.php:33wp-content/plugins/
   the-events-calendar/common/vendor/vendor-prefixed/stellarwp/db/src/DB/QueryBuilder/
   Clauses/Select.php:31_
 * These register as generated by **_Plugin: the-events-calendar_**
 * I need your assistance to fix this error. If you need additional details please
   let me know.
   Thanks in advance.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fphp-fatal-error-trim%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Support [iammarta](https://wordpress.org/support/users/iammarta/)
 * (@iammarta)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/php-fatal-error-trim/#post-17144837)
 * Hi [@jahrat](https://wordpress.org/support/users/jahrat/),
   Thanks for reaching
   out!Is The Events Calendar up to date? If not, please update our plugin to the
   latest version and let us know if you’re still having the same issue.As always,
   we recommend testing updates on a staging site first.Best regards,Marta
 *  Thread Starter [jahrat](https://wordpress.org/support/users/jahrat/)
 * (@jahrat)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/php-fatal-error-trim/#post-17144955)
 * My plugin is at version 6.2.4 and the error persist.
 *  Plugin Support [WilloftheD](https://wordpress.org/support/users/abzlevelup/)
 * (@abzlevelup)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/php-fatal-error-trim/#post-17144958)
 * Hi [@jahrat](https://wordpress.org/support/users/jahrat/), thanks for bringing
   this to our attention. A bit more information will definitely help, seems like
   you shared only a summary of the error log . Can you share with us the entire
   log with the Fatal Error? I’m curious since this one shouldn’t cause a fatal 
   error. Something unexpected happening there. Also can you share which PHP and
   WordPress version are you using.
   I suspect there’s a conflict that’s causing 
   the issue here as well. It would be good [Testing for Conflicts](https://theeventscalendar.com/knowledgebase/k/testing-for-conflicts/).
   To be safe, we’d recommend conducting tests and updates on a [Staging Server](https://theeventscalendar.com/knowledgebase/k/creating-and-using-a-wordpress-staging-site/).
   Also, please keep a working backup of your website.
 * Thank you so much.
 *  Thread Starter [jahrat](https://wordpress.org/support/users/jahrat/)
 * (@jahrat)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/php-fatal-error-trim/#post-17145051)
 * Hello [@abzlevelup](https://wordpress.org/support/users/abzlevelup/),
 * I went through the conflict testing and the only plugin that stopped the error
   was Event Calendar. I changed to a generic Word Press theme (twenty-twenty) and
   it did not help. I disabled all my plugins (one at a time over several weeks)
   and none helped. I am running WordPress 6.3.2 and PHP 8.2.5. The full log is 
   below.
 * **_[23-Oct-2023 16:39:20 UTC] PHP Fatal error: Uncaught TypeError: ltrim(): Argument#
   1 ($string) must be of type string, array given in /…/wp-includes/formatting.
   php:4477
   Stack trace: 
   _
   _0 /…/wp-includes/formatting.php(4477): ltrim(Array)
   __1 /…/wp-content/plugins/jetpack/functions.opengraph.php(261): esc\_url(Array)
   __2 /…/wp-includes/class-wp-hook.php(310): jetpack\_og\_tags(”) __3 /…/wp-includes/
   class-wp-hook.php(334): WP\_Hook->apply\_filters(NULL, Array) __4 /…/wp-includes/
   plugin.php(517): WP\_Hook->do\_action(Array) __5 /…/wp-includes/general-template.
   php(3053): do\_action(‘wp\_head’) __6 /…/wp-content/themes/kadence/header.php(
   24): wp\_head() __7 /…/wp-includes/template.php(785): require\_once(‘/home/dh\
   _27ci95…’) __8 /…/wp-includes/template.php(720): load\_template(‘/home/dh\_27ci95…’,
   true, Array) __9 /…/wp-includes/general-template.php(48): locate\_template(Array,
   true, true, Array) __10 /…/wp-content/themes/kadence/tribe/events/v2/default-
   template.php(17): get\_header() __11 /…/wp-includes/template-loader.php(106):
   include(‘/home/dh\_27ci95…’) __12 /…/wp-blog-header.php(19): require\_once(‘/
   home/dh\_27ci95…’) __13 /…/index.php(17): require(‘/home/dh\_27ci95…’) __14 {
   main} __thrown in /…/wp-includes/formatting.php on line 4477_
 *  Plugin Support [iammarta](https://wordpress.org/support/users/iammarta/)
 * (@iammarta)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/php-fatal-error-trim/#post-17147840)
 * Hi [@jahrat](https://wordpress.org/support/users/jahrat/),
   Our plugins are mostly
   compatible with PHP 8.1, but we’re currently not fully compatible with PHP 8.2.
   Please check out this link: [https://theeventscalendar.com/known-issues/#php8-compatibility](https://theeventscalendar.com/known-issues/#php8-compatibility).
   Can you try downgrading your PHP version and let us know how it goes?
 * Best regards,
   Marta
 *  Thread Starter [jahrat](https://wordpress.org/support/users/jahrat/)
 * (@jahrat)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/php-fatal-error-trim/#post-17153546)
 * Hello [@iammarta](https://wordpress.org/support/users/iammarta/),
 * I am closing this ticket for now as I may not get back to this in the near term.
   This is only an error seen in my logs and does not so far affect the functionality
   of my site. When additional information is available I will raise a new ticket.
 *  [Guga Alves](https://wordpress.org/support/users/gugaalves/)
 * (@gugaalves)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/php-fatal-error-trim/#post-17201549)
 * Hi [@jahrat](https://wordpress.org/support/users/jahrat/),
 * We’re happy to inform you that this issue has been fixed.
 * As always, we recommend [testing updates on a staging site](https://theeventscalendar.com/knowledgebase/k/creating-and-using-a-wordpress-staging-site/)
   first and keeping a recent backup, but the update should work smoothly.
 * Please upgrade your Events Calendar plugin to apply this fix to your site.
 * Best regards,
 *  Thread Starter [jahrat](https://wordpress.org/support/users/jahrat/)
 * (@jahrat)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/php-fatal-error-trim/#post-17201605)
 * Hello [@gugaalves](https://wordpress.org/support/users/gugaalves/),
 * I have installed the update and will let you know if the fault still exists.
 *  Plugin Support [Darian](https://wordpress.org/support/users/d0153/)
 * (@d0153)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/php-fatal-error-trim/#post-17218744)
 * Hi [@jahrat](https://wordpress.org/support/users/jahrat/)
 * Please do not hesitate to start a new thread if you have other issues at all.
   This allows us to track topics/issues efficiently and follow the[ WordPress Forum Guidelines](https://wordpress.org/support/guidelines/).

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

The topic ‘PHP Fatal Error – Trim’ is closed to new replies.

 * ![](https://ps.w.org/the-events-calendar/assets/icon-256x256.gif?rev=2516440)
 * [The Events Calendar](https://wordpress.org/plugins/the-events-calendar/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/the-events-calendar/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/the-events-calendar/)
 * [Active Topics](https://wordpress.org/support/plugin/the-events-calendar/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/the-events-calendar/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/the-events-calendar/reviews/)

## Tags

 * [PHP Fatal error](https://wordpress.org/support/topic-tag/php-fatal-error/)

 * 9 replies
 * 5 participants
 * Last reply from: [Darian](https://wordpress.org/support/users/d0153/)
 * Last activity: [2 years, 6 months ago](https://wordpress.org/support/topic/php-fatal-error-trim/#post-17218744)
 * Status: resolved