Commit b51e1b6e869 for php

commit b51e1b6e869223a5d7acc02bb6c5c3a9f2e31d94
Author: ChrisAbner <chrisabner@hotmail.com>
Date:   Thu Dec 3 17:59:07 2026 +0800

    ext/intl: Reset the intl error in Locale::isRightToLeft() (#26040)

    Locale::isRightToLeft() does not call ICU with a status, so a successful
    call left the global intl error from a preceding failure unchanged.
    Reset the error on entry and cover both the method and procedural alias.

    Add a NEWS entry for PHP 8.5.

    Closes #26040

diff --git a/NEWS b/NEWS
index 85c58773520..1703f0597a9 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,8 @@ PHP                                                                        NEWS
     returning null with libenchant 2. Both now return false. (lacatoire)

 - Intl:
+  . Fixed Locale::isRightToLeft() and locale_is_right_to_left() retaining a
+    stale global intl error after a successful call. (ChrisAbner)
   . Fixed NULL pointer dereference in IntlListFormatter::format() on an
     unconstructed object. (hohphu8)

diff --git a/ext/intl/locale/locale_methods.cpp b/ext/intl/locale/locale_methods.cpp
index d3df381c11e..15a3f4f8e22 100644
--- a/ext/intl/locale/locale_methods.cpp
+++ b/ext/intl/locale/locale_methods.cpp
@@ -1645,6 +1645,8 @@ U_CFUNC PHP_FUNCTION(locale_is_right_to_left)
 	char *locale;
 	size_t locale_len;

+	intl_error_reset(NULL);
+
 	ZEND_PARSE_PARAMETERS_START(1, 1)
 		Z_PARAM_PATH(locale, locale_len)
 	ZEND_PARSE_PARAMETERS_END();
diff --git a/ext/intl/tests/locale_is_right_to_left_error_reset.phpt b/ext/intl/tests/locale_is_right_to_left_error_reset.phpt
new file mode 100644
index 00000000000..8894213c48d
--- /dev/null
+++ b/ext/intl/tests/locale_is_right_to_left_error_reset.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Locale::isRightToLeft() resets the intl error on success
+--EXTENSIONS--
+intl
+--FILE--
+<?php
+$df = new IntlDateFormatter('en_US', IntlDateFormatter::NONE, IntlDateFormatter::NONE, 'UTC', IntlDateFormatter::GREGORIAN, 'yyyy');
+
+var_dump($df->parse('x'));
+var_dump(intl_error_name(intl_get_error_code()));
+var_dump(Locale::isRightToLeft('ar'));
+var_dump(intl_error_name(intl_get_error_code()));
+var_dump(intl_get_error_message());
+
+var_dump($df->parse('x'));
+var_dump(locale_is_right_to_left('en'));
+var_dump(intl_error_name(intl_get_error_code()));
+?>
+--EXPECT--
+bool(false)
+string(13) "U_PARSE_ERROR"
+bool(true)
+string(12) "U_ZERO_ERROR"
+string(12) "U_ZERO_ERROR"
+bool(false)
+bool(false)
+string(12) "U_ZERO_ERROR"