1--TEST--
2IntlRuleBasedBreakIterator::getBinaryRules(): basic test icu >= 61.1 && icu < 68.1
3--SKIPIF--
4<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
5<?php if(version_compare(INTL_ICU_VERSION, '61.1') < 0) print 'skip ICU >= 61.1 only'; ?>
6<?php if (version_compare(INTL_ICU_VERSION, '68.1') >= 0) die('skip for ICU < 68.1'); ?>
7--FILE--
8<?php
9ini_set("intl.error_level", E_WARNING);
10ini_set("intl.default_locale", "pt_PT");
11
12$rules = <<<RULES
13\$LN = [[:letter:] [:number:]];
14\$S = [.;,:];
15
16!!forward;
17\$LN+ {1};
18\$S+ {42};
19!!reverse;
20\$LN+ {1};
21\$S+ {42};
22!!safe_forward;
23!!safe_reverse;
24RULES;
25$rbbi = new IntlRuleBasedBreakIterator($rules);
26$rbbi->setText('sdfkjsdf88á.... ,;');
27
28$br = $rbbi->getBinaryRules();
29
30$rbbi2 = new IntlRuleBasedBreakIterator($br, true);
31
32var_dump($rbbi->getRules(), $rbbi2->getRules());
33var_dump($rbbi->getRules() == $rbbi2->getRules());
34?>
35==DONE==
36--EXPECT--
37string(137) "$LN = [[:letter:] [:number:]];
38$S = [.;,:];
39!!forward;
40$LN+ {1};
41$S+ {42};
42!!reverse;
43$LN+ {1};
44$S+ {42};
45!!safe_forward;
46!!safe_reverse;"
47string(137) "$LN = [[:letter:] [:number:]];
48$S = [.;,:];
49!!forward;
50$LN+ {1};
51$S+ {42};
52!!reverse;
53$LN+ {1};
54$S+ {42};
55!!safe_forward;
56!!safe_reverse;"
57bool(true)
58==DONE==
59