From b77041ff28407a447a516cf504fcd29dc2bdc146 Mon Sep 17 00:00:00 2001 From: Meirza Date: Fri, 10 Feb 2023 23:17:12 +0700 Subject: [PATCH] MDL-77207 core: PHP 8.2 makes exported class name fully qualified. --- lib/tests/moodlelib_test.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/tests/moodlelib_test.php b/lib/tests/moodlelib_test.php index 7aa43a8d5f2..991c4ceef8d 100644 --- a/lib/tests/moodlelib_test.php +++ b/lib/tests/moodlelib_test.php @@ -2326,8 +2326,12 @@ class moodlelib_test extends \advanced_testcase { // Call var_export() on a newly generated lang_string. $str = new lang_string('no'); + // In PHP 8.2 exported class names are now fully qualified; + // previously, the leading backslash was omitted. + $leadingbackslash = (version_compare(PHP_VERSION, '8.2.0', '>=')) ? '\\' : ''; + $expected1 = << 'no', 'component' => 'moodle', 'a' => NULL,