From 06e0bd9b8c02aaaef9103761e2cbd64771d45b93 Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Wed, 24 Sep 2025 07:52:05 +0200 Subject: [PATCH 1/6] Use SplObjectStorage::offsetSet() instead of deprecated SplObjectStorage::attach() --- tests/ExporterTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ExporterTest.php b/tests/ExporterTest.php index 276be6d..3892cbf 100644 --- a/tests/ExporterTest.php +++ b/tests/ExporterTest.php @@ -39,7 +39,7 @@ class ExporterTest extends TestCase $obj->self = $obj; $storage = new \SplObjectStorage; - $storage->attach($obj2); + $storage->offsetSet($obj2); $storage->foo = $obj2; $resource = \fopen('php://memory', 'r'); From e63685f2fc25ae7682d6bd9f63d7a0edac89ba1b Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Wed, 24 Sep 2025 07:55:01 +0200 Subject: [PATCH 2/6] Suppress warning --- tests/ExporterTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ExporterTest.php b/tests/ExporterTest.php index 3892cbf..85a5390 100644 --- a/tests/ExporterTest.php +++ b/tests/ExporterTest.php @@ -40,7 +40,7 @@ class ExporterTest extends TestCase $storage = new \SplObjectStorage; $storage->offsetSet($obj2); - $storage->foo = $obj2; + @$storage->foo = $obj2; $resource = \fopen('php://memory', 'r'); \fclose($resource); From 64cfeaa341951ceb2019d7b98232399d57bb2296 Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Wed, 24 Sep 2025 07:55:14 +0200 Subject: [PATCH 3/6] 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'; From 14c6ba52f95a36c3d27c835d65efc7123c446e8c Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Wed, 24 Sep 2025 08:03:27 +0200 Subject: [PATCH 4/6] Prepare release --- ChangeLog.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ChangeLog.md b/ChangeLog.md index e37807b..5c1e656 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. +## [4.0.8] - 2025-09-24 + +### Changed + +* Suppress `unexpected NAN value was coerced to string` warning triggered on PHP 8.5 + ## [4.0.7] - 2025-09-22 ### Changed @@ -50,6 +56,7 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt * This component is no longer supported on PHP 7.0, PHP 7.1, and PHP 7.2 +[4.0.8]: https://github.com/sebastianbergmann/exporter/compare/4.0.7...4.0.8 [4.0.7]: https://github.com/sebastianbergmann/exporter/compare/4.0.6...4.0.7 [4.0.6]: https://github.com/sebastianbergmann/exporter/compare/4.0.5...4.0.6 [4.0.5]: https://github.com/sebastianbergmann/exporter/compare/4.0.4...4.0.5 From 0735b90f4da94969541dac1da743446e276defa6 Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Wed, 24 Sep 2025 08:09:11 +0200 Subject: [PATCH 5/6] Prepare release --- ChangeLog.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ChangeLog.md b/ChangeLog.md index 4f2ebec..89fd353 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. +## [5.1.4] - 2025-09-24 + +### Changed + +* Suppress `unexpected NAN value was coerced to string` warning triggered on PHP 8.5 + ## [5.1.3] - 2025-09-22 ### Changed @@ -26,6 +32,7 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt * [#51](https://github.com/sebastianbergmann/exporter/pull/51): Export arrays using short array syntax +[5.1.4]: https://github.com/sebastianbergmann/exporter/compare/5.1.3...5.1.4 [5.1.3]: https://github.com/sebastianbergmann/exporter/compare/5.1.2...5.1.3 [5.1.2]: https://github.com/sebastianbergmann/exporter/compare/5.1.1...5.1.2 [5.1.1]: https://github.com/sebastianbergmann/exporter/compare/5.1.0...5.1.1 From 70a298763b40b213ec087c51c739efcaa90bcd74 Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Wed, 24 Sep 2025 08:12:51 +0200 Subject: [PATCH 6/6] Prepare release --- ChangeLog.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ChangeLog.md b/ChangeLog.md index 74033a9..aede7ce 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. +## [6.3.2] - 2025-09-24 + +### Changed + +* Suppress `unexpected NAN value was coerced to string` warning triggered on PHP 8.5 + ## [6.3.1] - 2025-09-22 ### Changed @@ -18,5 +24,6 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt * Optional argument for `shortenedRecursiveExport()` and `shortenedExport()` to control maximum string length +[6.3.2]: https://github.com/sebastianbergmann/exporter/compare/6.3.1...6.3.2 [6.3.1]: https://github.com/sebastianbergmann/exporter/compare/6.3.0...6.3.1 [6.3.0]: https://github.com/sebastianbergmann/exporter/compare/6.2.0...6.3.0