1--TEST--
2SPL: RegexIterator::setMode() error tests
3--CREDITS--
4Felix De Vliegher <felix.devliegher@gmail.com>
5--FILE--
6<?php
7
8$array = array('foo', 'bar', 'baz');
9$regexIterator = new RegexIterator(new ArrayIterator($array), "/f/");
10
11var_dump($regexIterator->getMode());
12
13try {
14	$regexIterator->setMode(7);
15} catch (InvalidArgumentException $e) {
16	var_dump($e->getMessage());
17	var_dump($e->getCode());
18}
19
20$regexIterator->setMode('foo');
21
22?>
23--EXPECTF--
24int(0)
25string(14) "Illegal mode 7"
26int(0)
27
28Warning: RegexIterator::setMode() expects parameter 1 to be int, string given in %s on line %d
29