From 8e8a3a27368b1ce665de3a6725e9d61a94d33648 Mon Sep 17 00:00:00 2001 From: dualfroz Date: Wed, 23 Sep 2026 05:53:46 +0200 Subject: [PATCH] Detect scientific notation without a function call that breaks purity analysis --- src/Converter/Time/PhpTimeConverter.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Converter/Time/PhpTimeConverter.php b/src/Converter/Time/PhpTimeConverter.php index 3d15111..474fb50 100644 --- a/src/Converter/Time/PhpTimeConverter.php +++ b/src/Converter/Time/PhpTimeConverter.php @@ -26,7 +26,6 @@ use function dechex; use function explode; use function is_float; use function is_int; -use function str_contains; use function str_pad; use function strlen; use function substr; @@ -145,7 +144,7 @@ class PhpTimeConverter implements TimeConverterInterface // Near zero PHP renders the float in scientific notation ("-1.0E-6"), whose // exponent would be misparsed as microseconds; fall back instead. - if (str_contains($split[1], 'E')) { + if (count(explode('E', $split[1], 2)) === 2) { return []; }