Bug #66702 [NEW]: RegexIterator::REGIT_INVERTED not implemented correctly

From: Date: Wed, 12 Feb 2014 20:09:25 +0000
Subject: Bug #66702 [NEW]: RegexIterator::REGIT_INVERTED not implemented correctly
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-184274@lists.php.net to get a copy of this message
From:             jthijssen+php at noxlogic dot nl
Operating system: 
PHP version:      master-Git-2014-02-12 (Git)
Package:          SPL related
Bug Type:         Bug
Bug description:RegexIterator::REGIT_INVERTED not implemented correctly

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
)

-- 
Edit bug report at https://bugs.php.net/bug.php?id=66702&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=66702&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=66702&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=66702&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=66702&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=66702&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=66702&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=66702&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=66702&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=66702&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=66702&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=66702&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=66702&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=66702&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66702&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=66702&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=66702&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=66702&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66702&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=66702&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=66702&r=mysqlcfg



Thread (2 messages)

« previous php.bugs (#184274) next »