xref: /PHP-8.2/ext/intl/tests/bug62759.phpt (revision 74859783)
1--TEST--
2Bug #62759: Buggy grapheme_substr() on edge case
3--EXTENSIONS--
4intl
5--FILE--
6<?php
7var_dump(substr('deja', 1, -4));
8var_dump(substr('deja', -1, 0));
9var_dump(grapheme_substr('deja', 1, -4));
10var_dump(intl_get_error_message());
11var_dump(grapheme_substr('deja', -1, 0));
12var_dump(grapheme_substr('déjà', 1, -4));
13var_dump(intl_get_error_message());
14var_dump(grapheme_substr('déjà', -1, 0));
15?>
16--EXPECT--
17string(0) ""
18string(0) ""
19string(0) ""
20string(12) "U_ZERO_ERROR"
21string(0) ""
22string(0) ""
23string(12) "U_ZERO_ERROR"
24string(0) ""
25