1--TEST--
2SPL: RegexIterator::getFlags() and setFlags() basic tests
3--CREDITS--
4Felix De Vliegher <felix.devliegher@gmail.com>
5--FILE--
6<?php
7
8$array = array('foo', 'bar', 'baz');
9$iterator = new ArrayIterator($array);
10$regexIterator = new RegexIterator($iterator, "/f/", null, RegexIterator::USE_KEY);
11
12var_dump($regexIterator->getFlags() === RegexIterator::USE_KEY);
13
14// Test a change in flags, there's only one class constant so it has to be another int value
15$regexIterator->setFlags(3);
16var_dump($regexIterator->getFlags() === RegexIterator::USE_KEY);
17$regexIterator->setFlags(RegexIterator::USE_KEY);
18var_dump($regexIterator->getFlags() === RegexIterator::USE_KEY);
19
20?>
21--EXPECT--
22bool(true)
23bool(false)
24bool(true)
25