|
5 | 5 | --FILE-- |
6 | 6 | <?php |
7 | 7 |
|
8 | | -function print_exception($e) { |
9 | | - echo "\nException: " . $e->getMessage() . " in " . $e->getFile() . " on line " . $e->getLine() . "\n"; |
10 | | -} |
11 | | - |
12 | 8 | //missing ; at the end: |
13 | 9 | try { |
14 | 10 | var_dump(new IntlRuleBasedBreakIterator('[\p{Letter}\uFFFD]+;[:number:]+')); |
15 | | -} catch (IntlException $e) { |
16 | | - print_exception($e); |
| 11 | +} catch (Throwable $e) { |
| 12 | + echo $e::class, ': ', $e->getMessage(), PHP_EOL; |
17 | 13 | } |
18 | 14 | try { |
19 | 15 | var_dump(new IntlRuleBasedBreakIterator()); |
20 | | -} catch (TypeError $e) { |
21 | | - print_exception($e); |
| 16 | +} catch (Throwable $e) { |
| 17 | + echo $e::class, ': ', $e->getMessage(), PHP_EOL; |
22 | 18 | } |
23 | 19 | try { |
24 | 20 | var_dump(new IntlRuleBasedBreakIterator(1,2,3)); |
25 | | -} catch (TypeError $e) { |
26 | | - print_exception($e); |
| 21 | +} catch (Throwable $e) { |
| 22 | + echo $e::class, ': ', $e->getMessage(), PHP_EOL; |
27 | 23 | } |
28 | 24 | try { |
29 | 25 | var_dump(new IntlRuleBasedBreakIterator('[\p{Letter}\uFFFD]+;[:number:]+;', array())); |
30 | | -} catch (TypeError $e) { |
31 | | - print_exception($e); |
| 26 | +} catch (Throwable $e) { |
| 27 | + echo $e::class, ': ', $e->getMessage(), PHP_EOL; |
32 | 28 | } |
33 | 29 | try { |
34 | 30 | var_dump(new IntlRuleBasedBreakIterator('[\p{Letter}\uFFFD]+;[:number:]+;', true)); |
35 | | -} catch (IntlException $e) { |
36 | | - print_exception($e); |
| 31 | +} catch (Throwable $e) { |
| 32 | + echo $e::class, ': ', $e->getMessage(), PHP_EOL; |
37 | 33 | } |
38 | 34 |
|
39 | 35 | $rbbi = new IntlRuleBasedBreakIterator(".;"); |
40 | 36 | try { |
41 | 37 | $rbbi->__construct(".;"); |
42 | | -} catch (Error $e) { |
43 | | - print_exception($e); |
| 38 | +} catch (Throwable $e) { |
| 39 | + echo $e::class, ': ', $e->getMessage(), PHP_EOL; |
44 | 40 | } |
45 | 41 | ?> |
46 | | ---EXPECTF-- |
47 | | -Exception: IntlRuleBasedBreakIterator::__construct(): unable to create RuleBasedBreakIterator from rules (parse error on line 1, offset 31) in %s on line %d |
48 | | - |
49 | | -Exception: IntlRuleBasedBreakIterator::__construct() expects at least 1 argument, 0 given in %s on line %d |
50 | | - |
51 | | -Exception: IntlRuleBasedBreakIterator::__construct() expects at most 2 arguments, 3 given in %s on line %d |
52 | | - |
53 | | -Exception: IntlRuleBasedBreakIterator::__construct(): Argument #2 ($compiled) must be of type bool, array given in %s on line %d |
54 | | - |
55 | | -Exception: IntlRuleBasedBreakIterator::__construct(): unable to create instance from compiled rules in %s on line %d |
56 | | - |
57 | | -Exception: IntlRuleBasedBreakIterator object is already constructed in %s on line %d |
| 42 | +--EXPECT-- |
| 43 | +IntlException: IntlRuleBasedBreakIterator::__construct(): unable to create RuleBasedBreakIterator from rules (parse error on line 1, offset 31) |
| 44 | +ArgumentCountError: IntlRuleBasedBreakIterator::__construct() expects at least 1 argument, 0 given |
| 45 | +ArgumentCountError: IntlRuleBasedBreakIterator::__construct() expects at most 2 arguments, 3 given |
| 46 | +TypeError: IntlRuleBasedBreakIterator::__construct(): Argument #2 ($compiled) must be of type bool, array given |
| 47 | +IntlException: IntlRuleBasedBreakIterator::__construct(): unable to create instance from compiled rules |
| 48 | +Error: IntlRuleBasedBreakIterator object is already constructed |
0 commit comments