From e00b56aac42eff81062c2e756945b2a1ad3d4d83 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Fri, 21 Mar 2025 13:16:51 -0400 Subject: [PATCH] Add check for mb_trim, as it's built-in on PHP 8.4 --- src/common.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/common.php b/src/common.php index d7b7d08..b74b846 100644 --- a/src/common.php +++ b/src/common.php @@ -19,12 +19,16 @@ use Query\{ConnectionManager, QueryBuilderInterface}; /** * Global functions that don't really fit anywhere else */ -/** - * Multibyte-safe trim function - */ -function mb_trim(string $string): string + +if ( ! function_exists('mb_trim')) { - return preg_replace('/(^\s+)|(\s+$)/u', '', $string); + /** + * Multibyte-safe trim function + */ + function mb_trim(string $string): string + { + return preg_replace('/(^\s+)|(\s+$)/u', '', $string); + } } /**