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