1--TEST-- 2IntlBreakIterator::setText(): arg errors 3--SKIPIF-- 4<?php 5if (!extension_loaded('intl')) 6 die('skip intl extension not enabled'); 7--FILE-- 8<?php 9ini_set("intl.error_level", E_WARNING); 10 11$bi = new IntlRuleBasedBreakIterator('[\p{Letter}]+;'); 12var_dump($bi->setText()); 13var_dump($bi->setText(array())); 14var_dump($bi->setText(1,2)); 15 16class A { 17function __destruct() { var_dump('destructed'); throw new Exception('e'); } 18function __tostring() { return 'foo'; } 19} 20 21try { 22var_dump($bi->setText(new A)); 23} catch (Exception $e) { 24var_dump($e->getMessage()); 25} 26 27--EXPECTF-- 28 29Warning: IntlBreakIterator::setText() expects exactly 1 parameter, 0 given in %s on line %d 30 31Warning: IntlBreakIterator::setText(): breakiter_set_text: bad arguments in %s on line %d 32bool(false) 33 34Warning: IntlBreakIterator::setText() expects parameter 1 to be string, array given in %s on line %d 35 36Warning: IntlBreakIterator::setText(): breakiter_set_text: bad arguments in %s on line %d 37bool(false) 38 39Warning: IntlBreakIterator::setText() expects exactly 1 parameter, 2 given in %s on line %d 40 41Warning: IntlBreakIterator::setText(): breakiter_set_text: bad arguments in %s on line %d 42bool(false) 43string(10) "destructed" 44string(1) "e" 45