Skip to content

ext/intl: Fix argument positions in transliterator_transliterate() error message#22331

Closed
LamentXU123 wants to merge 1 commit into
php:PHP-8.4from
LamentXU123:intl-arg-position
Closed

ext/intl: Fix argument positions in transliterator_transliterate() error message#22331
LamentXU123 wants to merge 1 commit into
php:PHP-8.4from
LamentXU123:intl-arg-position

Conversation

@LamentXU123

@LamentXU123 LamentXU123 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

A missed case in #22044

<?php
  $tr = Transliterator::create('latin');

  try {
      transliterator_transliterate($tr, 'abc', 2, 1);
  } catch (ValueError $e) {
      echo $e->getMessage(), "\n";
  }

returns

transliterator_transliterate(): Argument #2 ($string) must be less than or equal to argument #3 ($end)

but I expect

transliterator_transliterate(): Argument #3 ($start) must be less than or equal to argument #4 ($end)

reproduce here

Now I think there won't be similar cases in the code base after this fix.

@LamentXU123 LamentXU123 requested a review from devnexen as a code owner June 16, 2026 09:52
@LamentXU123 LamentXU123 changed the title ext/intl: Fix argument positions in transliterator_transliterate() ext/intl: Fix argument positions in transliterator_transliterate() error message Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants