blob: 10df255f4a0126fec9582cb8c8b6ef876c1ecccd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
--TEST--
SPL: RegexIterator::setMode() error tests
--CREDITS--
Felix De Vliegher <felix.devliegher@gmail.com>
--FILE--
<?php
$array = array('foo', 'bar', 'baz');
$regexIterator = new RegexIterator(new ArrayIterator($array), "/f/");
var_dump($regexIterator->getMode());
try {
$regexIterator->setMode(7);
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
var_dump($e->getCode());
}
?>
--EXPECT--
int(0)
RegexIterator::setMode(): Argument #1 ($mode) must be RegexIterator::MATCH, RegexIterator::GET_MATCH, RegexIterator::ALL_MATCHES, RegexIterator::SPLIT, or RegexIterator::REPLACE
int(0)
|