Annotation of embedaddon/php/ext/spl/tests/regexIterator_flags_basic.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: SPL: RegexIterator::getFlags() and setFlags() basic tests
3: --CREDITS--
4: Felix 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:
12: var_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);
16: var_dump($regexIterator->getFlags() === RegexIterator::USE_KEY);
17: $regexIterator->setFlags(RegexIterator::USE_KEY);
18: var_dump($regexIterator->getFlags() === RegexIterator::USE_KEY);
19:
20: ?>
21: --EXPECT--
22: bool(true)
23: bool(false)
24: bool(true)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>