From 08fe3cf32cbf836ac478cd34766a25ff044d5143 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Mon, 6 Nov 2023 11:57:27 +0000 Subject: [PATCH] Add workaround for PHP 8.3 adding true type --- tests/func_015.phpt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/func_015.phpt b/tests/func_015.phpt index 067634d..944cf09 100644 --- a/tests/func_015.phpt +++ b/tests/func_015.phpt @@ -35,6 +35,11 @@ foreach (['', (object) [], '1234', 4.5, true, new \DateTimeImmutable(), new \Dat } catch (TypeError $e) { $message = $e->getMessage(); + if (PHP_VERSION_ID >= 80300) { + // PHP 8.3+ outputs "true given" instead of "bool given". + $message = str_replace('true given', 'bool given', $message); + } + // Workaround exception message not including type in PHP 7 so the same test can be used for both. if (PHP_MAJOR_VERSION === 7) { $message = str_replace('N/A given', var_type($input).' given', $message);