Bug #68128 [Opn]: Regression in RecursiveRegexIterator

From: Date: Mon, 06 Oct 2014 01:11:50 +0000
Subject: Bug #68128 [Opn]: Regression in RecursiveRegexIterator
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-187872@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68128&edit=1 ID: 68128 Updated by: datibbaw@php.net Reported by: ivan dot enderlin at hoa-project dot net Summary: Regression in RecursiveRegexIterator Status: Open Type: Bug Package: *General Issues PHP Version: master-Git-2014-10-01 (Git) Block user comment: N Private report: N New Comment: Tracked the issue down to this commit: http://git.php.net/?p=php-src.git;a=commit;h=d81ea16ef14735b97f22702ca1a78c3674fd987e After the change it no longer silently converts arrays into string("Array") and this affects RecursiveRegexFilterIterator::accept(). Previous Comments: ------------------------------------------------------------------------ [2014-10-05 13:26:30] ivan dot enderlin at hoa-project dot net From PHP5.4 to 5.6.1, it fails: http://3v4l.org/msnnF. So this is not really a regression, this is just a bug from a long time (but it worked in 5.3). ------------------------------------------------------------------------ [2014-10-05 12:45:13] ivan dot enderlin at hoa-project dot net Also happens in PHP5.5.19-dev. ------------------------------------------------------------------------ [2014-10-05 10:15:06] ivan dot enderlin at hoa-project dot net Also happens in PHP5.6.2-dev. ------------------------------------------------------------------------ [2014-10-01 22:00:05] ivan dot enderlin at hoa-project dot net Description: ------------ There is a regression in the RecursiveRegexIterator iterator. Detected by the failure of a test in the Hoa\Iterator library. Test script from the documentation (http://php.net/recursiveregexiterator.construct). Test script: --------------- <?php $rArrayIterator = new RecursiveArrayIterator(array('test1', array('tet3', 'test4', 'test5'))); $rRegexIterator = new RecursiveRegexIterator($rArrayIterator, '/^test/', RecursiveRegexIterator::ALL_MATCHES); foreach ($rRegexIterator as $key1 => $value1) { if ($rRegexIterator->hasChildren()) { // print all children echo "Children: "; foreach ($rRegexIterator->getChildren() as $key => $value) { echo $value . " "; } echo "\n"; } else { echo "No children\n"; } } ?> Expected result: ---------------- No children Children: test4 test5 Actual result: -------------- Aucun fils disponible PHP Notice: Array to string conversion in /tmp/a.php on line 6 Notice: Array to string conversion in /tmp/a.php on line 6 Fils : test4 test5 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=68128&edit=1

« previous php.bugs (#187872) next »