From 4b190e862ee03c20a02aad146507de1d78f1d0f9 Mon Sep 17 00:00:00 2001 From: Cees-Jan Kiewiet Date: Tue, 18 Nov 2025 17:27:19 +0100 Subject: [PATCH 1/3] [3.x] Run CI jobs on PHP8.5 --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b2645b4..593f3ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,7 @@ jobs: strategy: matrix: php: + - 8.5 - 8.4 - 8.3 - 8.2 @@ -42,7 +43,7 @@ jobs: - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: - php-version: 8.2 + php-version: 8.5 coverage: xdebug ini-file: development - run: composer install From 21346c12231927ca1649404adbf664beb240c07d Mon Sep 17 00:00:00 2001 From: Cees-Jan Kiewiet Date: Tue, 18 Nov 2025 17:29:33 +0100 Subject: [PATCH 2/3] [3.x] Fix reflection setAccessible deprecatoin warnings In PHP8.1 ReflectionProperty::setAccessible was made a no-op through https://wiki.php.net/rfc/make-reflection-setaccessible-no-op in PHP8.5 it is now throwing a deprecation warning by: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_reflectionsetaccessible --- tests/DuplexResourceStreamTest.php | 4 +++- tests/ReadableResourceStreamTest.php | 4 +++- tests/WritableResourceStreamTest.php | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/DuplexResourceStreamTest.php b/tests/DuplexResourceStreamTest.php index c1076a6..d43ae73 100644 --- a/tests/DuplexResourceStreamTest.php +++ b/tests/DuplexResourceStreamTest.php @@ -33,7 +33,9 @@ public function testConstructWithoutLoopAssignsLoopAutomatically(): void $stream = new DuplexResourceStream($resource); $ref = new \ReflectionProperty($stream, 'loop'); - $ref->setAccessible(true); + if (PHP_VERSION_ID < 80100) { + $ref->setAccessible(true); + } $loop = $ref->getValue($stream); $this->assertInstanceOf('React\EventLoop\LoopInterface', $loop); diff --git a/tests/ReadableResourceStreamTest.php b/tests/ReadableResourceStreamTest.php index 3f7c144..520b1ea 100644 --- a/tests/ReadableResourceStreamTest.php +++ b/tests/ReadableResourceStreamTest.php @@ -32,7 +32,9 @@ public function testConstructWithoutLoopAssignsLoopAutomatically(): void $stream = new ReadableResourceStream($resource); $ref = new \ReflectionProperty($stream, 'loop'); - $ref->setAccessible(true); + if (PHP_VERSION_ID < 80100) { + $ref->setAccessible(true); + } $loop = $ref->getValue($stream); $this->assertInstanceOf('React\EventLoop\LoopInterface', $loop); diff --git a/tests/WritableResourceStreamTest.php b/tests/WritableResourceStreamTest.php index bc4fc42..2433c5f 100644 --- a/tests/WritableResourceStreamTest.php +++ b/tests/WritableResourceStreamTest.php @@ -31,7 +31,9 @@ public function testConstructWithoutLoopAssignsLoopAutomatically(): void $stream = new WritableResourceStream($resource); $ref = new \ReflectionProperty($stream, 'loop'); - $ref->setAccessible(true); + if (PHP_VERSION_ID < 80100) { + $ref->setAccessible(true); + } $loop = $ref->getValue($stream); $this->assertInstanceOf('React\EventLoop\LoopInterface', $loop); From 9f7df571bcae51657c2e63a69cd86358a7b8ec6a Mon Sep 17 00:00:00 2001 From: Cees-Jan Kiewiet Date: Tue, 18 Nov 2025 17:29:55 +0100 Subject: [PATCH 3/3] [3.x] Skip writing to a closed stream test on PHP8.5 While I couldn't pin it to the exact commit/PR/NEWS/UPGRADING item, PHP8.5 has seen a number of improvements to streams to make them less buggy. As a result, this test, which already confirmed the expected behavior is now failing because an error is tossed. --- tests/WritableResourceStreamTest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/WritableResourceStreamTest.php b/tests/WritableResourceStreamTest.php index 2433c5f..91925f0 100644 --- a/tests/WritableResourceStreamTest.php +++ b/tests/WritableResourceStreamTest.php @@ -511,6 +511,10 @@ public function testDoubleCloseWillEmitOnlyOnce(): void */ public function testWritingToClosedWritableResourceStreamShouldNotWriteToStream(): void { + if (PHP_VERSION_ID >= 80500) { + $this->markTestSkipped('Since PHP 8.5 attempting to write to a closed stream will result in an error'); + } + $stream = fopen('php://temp', 'r+'); assert(is_resource($stream));