From a9b5dcd9540015c47cba46f01e75da68f4c92fd9 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 9 Sep 2023 14:31:48 +0200 Subject: [PATCH 1/2] [ticket/17176] Use different call to cause a notice The previous call was upgraded to cause a warning in PHP 8.3 PHPBB3-17176 --- tests/error_collector_test.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/error_collector_test.php b/tests/error_collector_test.php index 6073eac6fe..3079ca1ffe 100644 --- a/tests/error_collector_test.php +++ b/tests/error_collector_test.php @@ -53,15 +53,14 @@ class phpbb_error_collector_test extends phpbb_test_case // Division by zero was promoted to fatal error and throws DivisionByZeroError exception in PHP 8+ version_compare(PHP_VERSION, '8', '>=') ? '1b'['0xFF'] : 1/0; $line = __LINE__; - // Cause a "Notice: unserialize(): Error at offset 0 of 27 bytes in ..." - // "Undefined array index" used earlier was promoted to warning in PHP 8.0, - // see https://github.com/php/php-src/commit/c48b745f0090c944e77c1fbcfb6c4df3b54356ad - unserialize("obvious non-serialized data"); $line2 = __LINE__; + // Cause a "Notice: date_default_timezone_set(): Timezone ID 'ThisTimeZoneDoesNotExist' is invalid" + // https://github.com/php/php-src/blob/880faa39e8c648bdc3aad7aeca170755c6557831/ext/date/php_date.c#L5205 + date_default_timezone_set('ThisTimeZoneDoesNotExist'); $line2 = __LINE__; $collector->uninstall(); // The notice should not be collected - $this->assertFalse(isset($collector->errors[1])); + $this->assertFalse(isset($collector->errors[1]), 'Notice should not be added to errors'); $this->assertEquals(count($collector->errors), 1); list($errno, $msg_text, $errfile, $errline) = $collector->errors[0]; From bf26da660a862ccf6269f317bff808ce65869555 Mon Sep 17 00:00:00 2001 From: rxu Date: Sun, 26 Nov 2023 22:44:40 +0700 Subject: [PATCH 2/2] [ticket/17233] Add PHP 8.3 tests to the 3.3.x branch PHPBB3-17233 --- .github/workflows/tests.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 731e438637..c8c597c01d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -126,6 +126,8 @@ jobs: db: "mysql:5.7" - php: '8.2' db: "mysql:5.7" + - php: '8.3' + db: "mysql:5.7" name: PHP ${{ matrix.php }} - ${{ matrix.db_alias != '' && matrix.db_alias || matrix.db }} @@ -257,6 +259,8 @@ jobs: db: "postgres:14" - php: '8.2' db: "postgres:14" + - php: '8.3' + db: "postgres:14" name: PHP ${{ matrix.php }} - ${{ matrix.db }} @@ -462,6 +466,9 @@ jobs: - php: '8.2' db: "postgres" type: 'unit' + - php: '8.3' + db: "postgres" + type: 'unit' - php: '7.4' db: "postgres" type: 'functional' @@ -474,6 +481,9 @@ jobs: - php: '8.2' db: "postgres" type: 'functional' + - php: '8.3' + db: "postgres" + type: 'functional' name: Windows - PHP ${{ matrix.php }} - ${{ matrix.db }} - ${{ matrix.type }}