From c93fd4c5da840e4ff3d92b587927149619e23ebd Mon Sep 17 00:00:00 2001 From: henderkes Date: Mon, 7 Sep 2026 00:20:19 +0200 Subject: [PATCH] perf: avoid floating-point formatting in microtime --- ext/standard/microtime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/standard/microtime.c b/ext/standard/microtime.c index ca8643eb5196..1ff5ea7c3333 100644 --- a/ext/standard/microtime.c +++ b/ext/standard/microtime.c @@ -75,7 +75,7 @@ static void _php_gettimeofday(INTERNAL_FUNCTION_PARAMETERS, int mode) timelib_time_offset_dtor(offset); } else { - RETURN_NEW_STR(zend_strpprintf(0, "%.8F %ld", tp.tv_usec / MICRO_IN_SEC, (long)tp.tv_sec)); + RETURN_NEW_STR(zend_strpprintf(0, "0.%06ld00 %ld", (long)tp.tv_usec, (long)tp.tv_sec)); } }