/hphp/test/zend/good/ext/spl/tests/bug66702.php
http://github.com/facebook/hiphop-php · PHP · 17 lines · 13 code · 1 blank · 3 comment · 0 complexity · 4642e8024ad874bd5dc85cfca1f77007 MD5 · raw file
- <?hh
- /**
- * @author Joshua Thijssen <jthijssen+php@noxlogic.nl>
- */
- <<__EntryPoint>> function main(): void {
- $it = new \ArrayIterator(varray["foo", "bar", "baz"]);
- $it2 = new \RegexIterator($it, "/^ba/", \RegexIterator::MATCH);
- print_r(iterator_to_array($it2));
- $it2 = new \RegexIterator($it, "/^ba/", \RegexIterator::MATCH, \RegexIterator::INVERT_MATCH);
- print_r(iterator_to_array($it2));
- $it = new \ArrayIterator(darray["foo" => 1, "bar" => 2, "baz" => 3]);
- $it2 = new \RegexIterator($it, "/^ba/", \RegexIterator::MATCH, \RegexIterator::USE_KEY);
- print_r(iterator_to_array($it2));
- $it2 = new \RegexIterator($it, "/^ba/", \RegexIterator::MATCH, \RegexIterator::USE_KEY | \RegexIterator::INVERT_MATCH);
- print_r(iterator_to_array($it2));
- }