Skip to content

intl_get_error_message() broken after MessageFormatter::formatMessage() fails #12020

Closed

Description

@TimWolla

Description

The following code:

<?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

Activity

  1. TimWolla commented on Aug 22, 2023

    @TimWolla
    MemberAuthor

    I suspect this regressed in 536dbd7, but did not test.

  2. TimWolla commented on Aug 22, 2023

    @TimWolla
    MemberAuthor

    /cc @Girgias who authored the commit above.

  3. self-assigned this
    on Aug 22, 2023
  4. added 4 commits that reference this issue on Sep 3, 2023
  5. Girgias commented on Sep 3, 2023

    @Girgias
    Member

    Fixed in a579fa8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions