hamcrest-php icon indicating copy to clipboard operation
hamcrest-php copied to clipboard

Wrong array pointer at end of _elementMatchers in SeriesMatchingOnce.php#34

Open h4cc opened this issue 9 years ago • 0 comments

When running the test with HHVM, a unexpected behaviour appears in https://github.com/hamcrest/hamcrest-php/blob/master/hamcrest/Hamcrest/Arrays/SeriesMatchingOnce.php#L34 in this line:

$nextMatcher = current($this->_elementMatchers);

Failing travis build: https://travis-ci.org/hamcrest/hamcrest-php/jobs/65859156

The problem was encountered in this Pull-Request: #27

Even though the array still contains 3 matchers, the function current return false because the internal array point is at the end of the file.

Todo:

  • [ ] Reproduce with PHP 5.3-5.6 using a PHPUnit test.
  • [ ] Locate where the array pointer is changed to wrong value.
  • [ ] Fix the cause.

h4cc avatar Jun 08 '15 17:06 h4cc