1--TEST-- 2IntlRuleBasedBreakIterator::__construct(): arg errors 3--SKIPIF-- 4<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> 5--FILE-- 6<?php 7ini_set("intl.error_level", E_WARNING); 8 9function print_exception($e) { 10 echo "\nException: " . $e->getMessage() . " in " . $e->getFile() . " on line " . $e->getLine() . "\n"; 11} 12 13//missing ; at the end: 14try { 15 var_dump(new IntlRuleBasedBreakIterator('[\p{Letter}\uFFFD]+;[:number:]+')); 16} catch (IntlException $e) { 17 print_exception($e); 18} 19try { 20 var_dump(new IntlRuleBasedBreakIterator()); 21} catch (TypeError $e) { 22 print_exception($e); 23} 24try { 25 var_dump(new IntlRuleBasedBreakIterator(1,2,3)); 26} catch (TypeError $e) { 27 print_exception($e); 28} 29try { 30 var_dump(new IntlRuleBasedBreakIterator('[\p{Letter}\uFFFD]+;[:number:]+;', array())); 31} catch (TypeError $e) { 32 print_exception($e); 33} 34try { 35 var_dump(new IntlRuleBasedBreakIterator('[\p{Letter}\uFFFD]+;[:number:]+;', true)); 36} catch (IntlException $e) { 37 print_exception($e); 38} 39--EXPECTF-- 40Exception: IntlRuleBasedBreakIterator::__construct(): rbbi_create_instance: unable to create RuleBasedBreakIterator from rules (parse error on line 1, offset 31) in %s on line %d 41 42Exception: IntlRuleBasedBreakIterator::__construct() expects at least 1 parameter, 0 given in %s on line %d 43 44Exception: IntlRuleBasedBreakIterator::__construct() expects at most 2 parameters, 3 given in %s on line %d 45 46Exception: IntlRuleBasedBreakIterator::__construct() expects parameter 2 to be bool, array given in %s on line %d 47 48Exception: IntlRuleBasedBreakIterator::__construct(): rbbi_create_instance: unable to create instance from compiled rules in %s on line %d 49