[php-src] Issue #12020: intl_get_error_message() broken after MessageFormatter::formatMessage() fails

From: Date: Tue, 22 Aug 2023 16:07:06 +0000
Subject: [php-src] Issue #12020: intl_get_error_message() broken after MessageFormatter::formatMessage() fails
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-245221@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/12020
Author: TimWolla

### Description

The following code:

```php
<?php
var_dump(\MessageFormatter::formatMessage('en', 'some message with {invalid
format}', []), intl_get_error_message());
var_dump(\MessageFormatter::formatMessage('en', 'some {wrong.format}', []),
intl_get_error_message());
```

Resulted in this output:
```
bool(false)
string(12) "U_ZERO_ERROR"
bool(false)
string(12) "U_ZERO_ERROR"
```

But I expected this output instead:
```
bool(false)
string(128) "pattern syntax error (parse error at offset 19, after " message with {",
before or at "invalid format}"): U_PATTERN_SYNTAX_ERROR"
bool(false)
string(116) "pattern syntax error (parse error at offset 6, after "some {", before or
at "wrong.format}"): U_PATTERN_SYNTAX_ERROR"
```

see: https://onlinephp.io?s=s7EvyCjg5SpLLIpPKc0t0IjxTS0uTkxPdcsvyk0sKUktsrJKAzOh4hrqqXnqOgrqxfm5qQq5EDGF8sySDIXqzLyyxJzMFAWI-lqgquhYTR2FzLySnPj01JL41KKi_KJ4qB4NTU1rcq2tLi_Kz0vXI8EeAA%2C%2C&v=8.2.9%2C8.1.22%2C8.0.30%2C8.2.8%2C8.1.21

### PHP Version

PHP 8.2.9

### Operating System

_No response_


Thread (1 message)

  • TimWolla
« previous php.bugs (#245221) next »