php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66702 RegexIterator::REGIT_INVERTED not implemented correctly
Submitted: 2014-02-12 20:09 UTC Modified: 2014-04-09 09:56 UTC
From: jthijssen+php at noxlogic dot nl Assigned: colder (profile)
Status: Closed Package: SPL related
PHP Version: master-Git-2014-02-12 (Git) OS:
Private report: No CVE-ID: None
 [2014-02-12 20:09 UTC] jthijssen+php at noxlogic dot nl
Description:
------------
The REGIT_INVERTED flag which can be set through the RegexIterator::__construct() or RegexIterator::setMode() isn't inverting the current return value.

Test script:
---------------
<?php
$it = new \ArrayIterator(array("foo", "bar", "baz"));
$it = new \RegexIterator($it, "/^ba/", \RegexIterator::MATCH, 2);
print_r(iterator_to_array($it));


Expected result:
----------------
array(
   [0] => foo
)

Actual result:
--------------
Array
(
    [1] => bar
    [2] => baz
)

Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-03-28 19:34 UTC] levim@php.net
-Assigned To: +Assigned To: colder
 [2014-04-09 09:56 UTC] colder@php.net
-Status: Assigned +Status: Closed
 [2014-04-09 09:56 UTC] colder@php.net
Merged as of PHP-5.5
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 12:01:31 2024 UTC