1--TEST--
2Transliterator::transliterate (error)
3--EXTENSIONS--
4intl
5--FILE--
6<?php
7
8ini_set("intl.error_level", E_WARNING);
9
10$tr = Transliterator::create("latin");
11
12//Arguments
13var_dump(transliterator_transliterate($tr,"str",7));
14
15try {
16    transliterator_transliterate($tr,"str",7,6);
17} catch (ValueError $exception) {
18    echo $exception->getMessage() . "\n";
19}
20
21//bad UTF-8
22transliterator_transliterate($tr, "\x80\x03");
23
24echo "Done.\n";
25?>
26--EXPECTF--
27Warning: transliterator_transliterate(): transliterator_transliterate: Neither "start" nor the "end" arguments can exceed the number of UTF-16 code units (in this case, 3) in %s on line %d
28bool(false)
29transliterator_transliterate(): Argument #2 ($string) must be less than or equal to argument #3 ($end)
30
31Warning: transliterator_transliterate(): String conversion of string to UTF-16 failed in %s on line %d
32Done.
33