Closed dereckson closed 7 years ago
Tests under PHP 5.6.30
PHPUnit 5.7.5-47-g58613c7c by Sebastian Bergmann and contributors.
... 3 / 3 (100%)
Time: 186 ms, Memory: 3.50MB
OK (3 tests, 8 assertions)
Tests under PHP 7.1.0
PHPUnit 5.7.5-47-g58613c7c by Sebastian Bergmann and contributors.
S.. 3 / 3 (100%)
Time: 216 ms, Memory: 4.00MB
OK, but incomplete, skipped, or risky tests!
Tests: 3, Assertions: 4, Skipped: 1.
Tests confirmed, thanks for your quick fix!
The array_shift PHP function expects an array to manipulate, stored in a variable. As such, it's a poor candidate to get the first element of an array, as it will raise a strict exception if we pass it a reference to an array instead.
We supersede array_shift by an universal function to get the first element of any array or object which implements the Traversable interface, kicking the iterator to pick th first element.
Fixes #9.