From 1c4637eb1ecc0b8fe6f0f95580da448da25b51e7 Mon Sep 17 00:00:00 2001 From: henderkes Date: Mon, 7 Sep 2026 11:29:05 +0200 Subject: [PATCH] perf: avoid float formatting in phpdbg's vasprintf fallback --- sapi/phpdbg/phpdbg_out.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sapi/phpdbg/phpdbg_out.c b/sapi/phpdbg/phpdbg_out.c index 6104112b232f..578b080aa351 100644 --- a/sapi/phpdbg/phpdbg_out.c +++ b/sapi/phpdbg/phpdbg_out.c @@ -101,7 +101,11 @@ int phpdbg_process_print(int fd, int type, const char *msg, int msglen) { if (msg) { struct timeval tp; if (gettimeofday(&tp, NULL) == SUCCESS) { +#ifdef HAVE_VASPRINTF msgoutlen = phpdbg_asprintf(&msgout, "[%ld %.8F]: %.*s\n", tp.tv_sec, tp.tv_usec / 1000000., msglen, msg); +#else + msgoutlen = phpdbg_asprintf(&msgout, "[%ld 0.%06ld00]: %.*s\n", tp.tv_sec, (long) tp.tv_usec, msglen, msg); +#endif } else { msgoutlen = FAILURE; }