xref: /PHP-8.3/ext/intl/tests/gh12020.phpt (revision a579fa80)
1--TEST--
2GitHub #12020 intl_get_error_message() broken after MessageFormatter::formatMessage() fails
3--EXTENSIONS--
4intl
5--FILE--
6<?php
7
8var_dump(\MessageFormatter::formatMessage('en', 'some message with {invalid format}', []), intl_get_error_message());
9var_dump(\MessageFormatter::formatMessage('en', 'some {wrong.format}', []), intl_get_error_message());
10
11var_dump(msgfmt_format_message('en', 'some message with {invalid format}', []), intl_get_error_message());
12var_dump(msgfmt_format_message('en', 'some {wrong.format}', []), intl_get_error_message());
13?>
14--EXPECT--
15bool(false)
16string(128) "pattern syntax error (parse error at offset 19, after " message with {", before or at "invalid format}"): U_PATTERN_SYNTAX_ERROR"
17bool(false)
18string(116) "pattern syntax error (parse error at offset 6, after "some {", before or at "wrong.format}"): U_PATTERN_SYNTAX_ERROR"
19bool(false)
20string(128) "pattern syntax error (parse error at offset 19, after " message with {", before or at "invalid format}"): U_PATTERN_SYNTAX_ERROR"
21bool(false)
22string(116) "pattern syntax error (parse error at offset 6, after "some {", before or at "wrong.format}"): U_PATTERN_SYNTAX_ERROR"
23