From 64cfeaa341951ceb2019d7b98232399d57bb2296 Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Wed, 24 Sep 2025 07:55:14 +0200 Subject: [PATCH] Suppress warning --- ChangeLog.md | 7 +++++++ src/Exporter.php | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index 2ada69d..93aad37 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -2,6 +2,12 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. +## [3.1.8] - 2025-09-24 + +### Changed + +* Suppress `unexpected NAN value was coerced to string` warning triggered on PHP 8.5 + ## [3.1.7] - 2025-09-22 ### Changed @@ -46,6 +52,7 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt * Remove HHVM-specific code that is no longer needed +[3.1.8]: https://github.com/sebastianbergmann/exporter/compare/3.1.7...3.1.8 [3.1.7]: https://github.com/sebastianbergmann/exporter/compare/3.1.6...3.1.7 [3.1.6]: https://github.com/sebastianbergmann/exporter/compare/3.1.5...3.1.6 [3.1.5]: https://github.com/sebastianbergmann/exporter/compare/3.1.4...3.1.5 diff --git a/src/Exporter.php b/src/Exporter.php index d46adf9..4560c09 100644 --- a/src/Exporter.php +++ b/src/Exporter.php @@ -215,7 +215,7 @@ class Exporter \ini_set('precision', '-1'); try { - $valueStr = (string) $value; + $valueStr = @(string) $value; if ((string) @(int) $value === $valueStr) { return $valueStr . '.0';