blob: 7bbd27ea45112edd758ed58d0a08b7ff3a6e51d3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
--TEST--
IntlBreakIterator::getPartsIterator(): argument variations
--SKIPIF--
<?php
if (!extension_loaded('intl'))
die('skip intl extension not enabled');
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "pt_PT");
$text = 'foo bar tao';
$it = IntlBreakIterator::createWordInstance(NULL);
$it->setText($text);
var_dump(iterator_to_array($it->getPartsIterator(IntlPartsIterator::KEY_SEQUENTIAL)));
var_dump(iterator_to_array($it->getPartsIterator(IntlPartsIterator::KEY_LEFT)));
var_dump(iterator_to_array($it->getPartsIterator(IntlPartsIterator::KEY_RIGHT)));
?>
==DONE==
--EXPECT--
array(5) {
[0]=>
string(3) "foo"
[1]=>
string(1) " "
[2]=>
string(3) "bar"
[3]=>
string(1) " "
[4]=>
string(3) "tao"
}
array(5) {
[0]=>
string(3) "foo"
[4]=>
string(1) " "
[5]=>
string(3) "bar"
[8]=>
string(1) " "
[9]=>
string(3) "tao"
}
array(5) {
[3]=>
string(3) "foo"
[5]=>
string(1) " "
[8]=>
string(3) "bar"
[9]=>
string(1) " "
[12]=>
string(3) "tao"
}
==DONE==
|