1--TEST--
2IntlRuleBasedBreakIterator::getBinaryRules(): basic test icu >= 61.1 && icu < 68.1
3--EXTENSIONS--
4intl
5--SKIPIF--
6<?php if(version_compare(INTL_ICU_VERSION, '61.1') < 0) print 'skip ICU >= 61.1 only'; ?>
7<?php if (version_compare(INTL_ICU_VERSION, '68.1') >= 0) die('skip for ICU < 68.1'); ?>
8--FILE--
9<?php
10ini_set("intl.error_level", E_WARNING);
11ini_set("intl.default_locale", "pt_PT");
12
13$rules = <<<RULES
14\$LN = [[:letter:] [:number:]];
15\$S = [.;,:];
16
17!!forward;
18\$LN+ {1};
19\$S+ {42};
20!!reverse;
21\$LN+ {1};
22\$S+ {42};
23!!safe_forward;
24!!safe_reverse;
25RULES;
26$rbbi = new IntlRuleBasedBreakIterator($rules);
27$rbbi->setText('sdfkjsdf88á.... ,;');
28
29$br = $rbbi->getBinaryRules();
30
31$rbbi2 = new IntlRuleBasedBreakIterator($br, true);
32
33var_dump($rbbi->getRules(), $rbbi2->getRules());
34var_dump($rbbi->getRules() == $rbbi2->getRules());
35?>
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