From d2e24159224933d1fc68b50c15c4faf0f61a44a9 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Tue, 16 Sep 2025 14:38:09 +0200 Subject: [PATCH 1/7] PHPC-2617: Run Github Actions tests on PHP 8.5 --- .github/workflows/tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ac706fa3e..a39d48a81 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,6 +25,7 @@ jobs: - "8.2" - "8.3" - "8.4" + - "8.5" mongodb-version: - "6.0" topology: @@ -125,6 +126,6 @@ jobs: fail-fast: false matrix: # Note: keep this in sync with the Windows matrix in package-release.yml - php: [ "8.1", "8.2", "8.3", "8.4" ] + php: [ "8.1", "8.2", "8.3", "8.4", "8.5" ] arch: [ x64, x86 ] ts: [ ts, nts ] From dbcb789eb9e1d456eeba9c581584f8416f68d243 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Tue, 16 Sep 2025 16:07:15 +0200 Subject: [PATCH 2/7] Remove usage of setAccessible in tests --- tests/exception/bulkwriteexception-haserrorlabel-001.phpt | 1 - tests/exception/bulkwriteexception-haserrorlabel_error-001.phpt | 1 - tests/exception/commandexception-getresultdocument-001.phpt | 1 - tests/exception/commandexception-haserrorlabel-001.phpt | 1 - tests/exception/commandexception-haserrorlabel_error-001.phpt | 1 - tests/exception/runtimeexception-haserrorlabel-001.phpt | 1 - tests/exception/runtimeexception-haserrorlabel_error-001.phpt | 1 - 7 files changed, 7 deletions(-) diff --git a/tests/exception/bulkwriteexception-haserrorlabel-001.phpt b/tests/exception/bulkwriteexception-haserrorlabel-001.phpt index 6a7a4b390..e1b18dc7e 100644 --- a/tests/exception/bulkwriteexception-haserrorlabel-001.phpt +++ b/tests/exception/bulkwriteexception-haserrorlabel-001.phpt @@ -9,7 +9,6 @@ $labels = ['test', 'foo']; $reflection = new ReflectionClass($exception); $resultDocumentProperty = $reflection->getProperty('errorLabels'); -$resultDocumentProperty->setAccessible(true); $resultDocumentProperty->setValue($exception, $labels); var_dump($exception->hasErrorLabel('foo')); diff --git a/tests/exception/bulkwriteexception-haserrorlabel_error-001.phpt b/tests/exception/bulkwriteexception-haserrorlabel_error-001.phpt index 229f50b1f..17d806d05 100644 --- a/tests/exception/bulkwriteexception-haserrorlabel_error-001.phpt +++ b/tests/exception/bulkwriteexception-haserrorlabel_error-001.phpt @@ -9,7 +9,6 @@ $labels = 'shouldBeAnArray'; $reflection = new ReflectionClass($exception); $resultDocumentProperty = $reflection->getProperty('errorLabels'); -$resultDocumentProperty->setAccessible(true); $resultDocumentProperty->setValue($exception, $labels); var_dump($exception->hasErrorLabel('bar')); diff --git a/tests/exception/commandexception-getresultdocument-001.phpt b/tests/exception/commandexception-getresultdocument-001.phpt index 40c8989f7..501a75b89 100644 --- a/tests/exception/commandexception-getresultdocument-001.phpt +++ b/tests/exception/commandexception-getresultdocument-001.phpt @@ -9,7 +9,6 @@ $resultDocument = (object) ['x' => 1]; $reflection = new ReflectionClass($exception); $resultDocumentProperty = $reflection->getProperty('resultDocument'); -$resultDocumentProperty->setAccessible(true); $resultDocumentProperty->setValue($exception, $resultDocument); var_dump($resultDocument === $exception->getResultDocument()); diff --git a/tests/exception/commandexception-haserrorlabel-001.phpt b/tests/exception/commandexception-haserrorlabel-001.phpt index 0a3389662..7c33f1210 100644 --- a/tests/exception/commandexception-haserrorlabel-001.phpt +++ b/tests/exception/commandexception-haserrorlabel-001.phpt @@ -9,7 +9,6 @@ $labels = ['test', 'foo']; $reflection = new ReflectionClass($exception); $resultDocumentProperty = $reflection->getProperty('errorLabels'); -$resultDocumentProperty->setAccessible(true); $resultDocumentProperty->setValue($exception, $labels); var_dump($exception->hasErrorLabel('foo')); diff --git a/tests/exception/commandexception-haserrorlabel_error-001.phpt b/tests/exception/commandexception-haserrorlabel_error-001.phpt index ea3241480..2631d6939 100644 --- a/tests/exception/commandexception-haserrorlabel_error-001.phpt +++ b/tests/exception/commandexception-haserrorlabel_error-001.phpt @@ -9,7 +9,6 @@ $labels = 'shouldBeAnArray'; $reflection = new ReflectionClass($exception); $resultDocumentProperty = $reflection->getProperty('errorLabels'); -$resultDocumentProperty->setAccessible(true); $resultDocumentProperty->setValue($exception, $labels); var_dump($exception->hasErrorLabel('bar')); diff --git a/tests/exception/runtimeexception-haserrorlabel-001.phpt b/tests/exception/runtimeexception-haserrorlabel-001.phpt index c9283045d..7918b564b 100644 --- a/tests/exception/runtimeexception-haserrorlabel-001.phpt +++ b/tests/exception/runtimeexception-haserrorlabel-001.phpt @@ -9,7 +9,6 @@ $labels = ['test', 'foo']; $reflection = new ReflectionClass($exception); $resultDocumentProperty = $reflection->getProperty('errorLabels'); -$resultDocumentProperty->setAccessible(true); $resultDocumentProperty->setValue($exception, $labels); var_dump($exception->hasErrorLabel('foo')); diff --git a/tests/exception/runtimeexception-haserrorlabel_error-001.phpt b/tests/exception/runtimeexception-haserrorlabel_error-001.phpt index d9de912d0..95760aad7 100644 --- a/tests/exception/runtimeexception-haserrorlabel_error-001.phpt +++ b/tests/exception/runtimeexception-haserrorlabel_error-001.phpt @@ -9,7 +9,6 @@ $labels = 'shouldBeAnArray'; $reflection = new ReflectionClass($exception); $resultDocumentProperty = $reflection->getProperty('errorLabels'); -$resultDocumentProperty->setAccessible(true); $resultDocumentProperty->setValue($exception, $labels); var_dump($exception->hasErrorLabel('bar')); From c41c0030ed84e4052715c1e81f693946e6845df3 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Tue, 16 Sep 2025 16:15:16 +0200 Subject: [PATCH 3/7] Remove non-canonical cast --- tests/server/server-construct-001.phpt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/server/server-construct-001.phpt b/tests/server/server-construct-001.phpt index 5c726c674..98c1f482c 100644 --- a/tests/server/server-construct-001.phpt +++ b/tests/server/server-construct-001.phpt @@ -20,7 +20,7 @@ $bulk->insert(array('foo' => 'bar')); $server = $manager->executeBulkWrite(NS, $bulk)->getServer(); $expectedHost = $parsed['host']; -$expectedPort = (integer) (isset($parsed['port']) ? $parsed['port'] : 27017); +$expectedPort = (int) (isset($parsed['port']) ? $parsed['port'] : 27017); var_dump($server->getHost() == $expectedHost); var_dump($server->getPort() == $expectedPort); From 117fd6ea5623b0770df50e09550b05fdec31a6ce Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Fri, 19 Sep 2025 09:33:55 +0200 Subject: [PATCH 4/7] Update setup-php-sdk to enable PHP 8.5 builds --- .github/actions/windows/prepare-build/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/windows/prepare-build/action.yml b/.github/actions/windows/prepare-build/action.yml index fe9236fbd..889e9383c 100644 --- a/.github/actions/windows/prepare-build/action.yml +++ b/.github/actions/windows/prepare-build/action.yml @@ -22,7 +22,7 @@ runs: steps: - name: Setup PHP SDK id: setup-php - uses: php/setup-php-sdk@v0.10 + uses: php/setup-php-sdk@v0.11 with: version: ${{ inputs.version }} arch: ${{ inputs.arch }} From 1ba173205105046208c37b3dd671d08db0091da5 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Wed, 24 Sep 2025 11:04:14 +0200 Subject: [PATCH 5/7] Package windows extensions for PHP 8.5 --- .github/workflows/package-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/package-release.yml b/.github/workflows/package-release.yml index b9e91915c..ef6fd319f 100644 --- a/.github/workflows/package-release.yml +++ b/.github/workflows/package-release.yml @@ -98,6 +98,6 @@ jobs: fail-fast: false matrix: # Note: keep this in sync with the Windows matrix in tests.yml - php: [ "8.1", "8.2", "8.3", "8.4" ] + php: [ "8.1", "8.2", "8.3", "8.4", "8.5" ] arch: [ x64, x86 ] ts: [ ts, nts ] From 558376630185c6fc2dfd0a71f28c873ade938c49 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Wed, 24 Sep 2025 16:39:20 +0200 Subject: [PATCH 6/7] Don't coerce NAN values to strings due to warnings --- tests/bson/bson-decimal128-002.phpt | 4 ---- tests/bson/bson-decimal128-004.phpt | 6 +++--- tests/bson/bson-decimal128-serialization-002.phpt | 6 +++--- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/tests/bson/bson-decimal128-002.phpt b/tests/bson/bson-decimal128-002.phpt index 6c0bdbb37..60286d84a 100644 --- a/tests/bson/bson-decimal128-002.phpt +++ b/tests/bson/bson-decimal128-002.phpt @@ -4,8 +4,6 @@ MongoDB\BSON\Decimal128 NaN values Date: Fri, 18 Jul 2025 14:43:07 +0200 Subject: [PATCH 7/7] use ZSTR_IS_INTERNED() (#1849) --- src/contrib/php_array_api.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contrib/php_array_api.h b/src/contrib/php_array_api.h index 5a973375a..5e88c5c74 100644 --- a/src/contrib/php_array_api.h +++ b/src/contrib/php_array_api.h @@ -350,7 +350,7 @@ char *php_array_zval_to_string(zval *z, int *plen, zend_bool *pfree) { zval c = *z; zval_copy_ctor(&c); convert_to_string(&c); - *pfree = ! IS_INTERNED(Z_STR(c)); + *pfree = ! ZSTR_IS_INTERNED(Z_STR(c)); *plen = Z_STRLEN(c); return Z_STRVAL(c); }