[php-src] PR #22119: ext/Intl: fix IntlListFormatter object error state after format() failures.
| From: | LamentXU123 | Date: | Fri, 22 May 2026 07:00:38 +0000 |
| Subject: | [php-src] PR #22119: ext/Intl: fix IntlListFormatter object error state after format() failures. | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-36193@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/22119
Author: LamentXU123
This fixes:
```php
<?php
$formatter = new IntlListFormatter('en_US');
var_dump($formatter->format(["\x80"])); // bool(false)
var_dump($formatter->getErrorCode()); // int(0)
var_dump($formatter->getErrorMessage()); // string(12) "U_ZERO_ERROR"
var_dump(intl_get_error_code()); // int(10)
var_dump(intl_get_error_message()); // string(...) "IntlListFormatter::format():
Failed to convert string to UTF-16: U_INVALID_CHAR_FOUND"
```
Which is because IntlListFormatter doesn't pass error status to object but only to global
status. Not yet found similar bugs.