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--EXPECTF--
27Warning: IntlBreakIterator::setText() expects exactly 1 parameter, 0 given in %s on line %d
28
29Warning: IntlBreakIterator::setText(): breakiter_set_text: bad arguments in %s on line %d
30bool(false)
31
32Warning: IntlBreakIterator::setText() expects parameter 1 to be string, array given in %s on line %d
33
34Warning: IntlBreakIterator::setText(): breakiter_set_text: bad arguments in %s on line %d
35bool(false)
36
37Warning: IntlBreakIterator::setText() expects exactly 1 parameter, 2 given in %s on line %d
38
39Warning: IntlBreakIterator::setText(): breakiter_set_text: bad arguments in %s on line %d
40bool(false)
41string(10) "destructed"
42string(1) "e"
43