1
0
mirror of https://github.com/php/php-src.git synced 2026-03-30 12:13:02 +02:00
Files
archived-php-src/ext/spl/tests/regexIterator_setMode_error.phpt
2019-03-11 11:32:20 +01:00

25 lines
462 B
PHP

--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 (InvalidArgumentException $e) {
var_dump($e->getMessage());
var_dump($e->getCode());
}
?>
--EXPECTF--
int(0)
string(14) "Illegal mode 7"
int(0)