diff --git a/src/Compiler/PCRECompiler.php b/src/Compiler/PCRECompiler.php index cbd1585..d211c56 100644 --- a/src/Compiler/PCRECompiler.php +++ b/src/Compiler/PCRECompiler.php @@ -290,7 +290,7 @@ protected function formatException(string $message, ?string $token = null): stri $message = \str_replace('Compilation failed: ', '', $message); $message = \preg_replace('/([\w_]+\(\):\h+)/', '', $message); - $message = \preg_replace('/\h*at\h+offset\h+\d+/', '', $message); + $message = \preg_replace('/\h*at\h+offset\h+\d+/', '', (string) $message); return \ucfirst((string) $message) . (\is_string($token) ? $suffix : ''); }