PHP nightly: Parameter must be an array or an object that implements Countable
<p>I am seeing <a href="https://travis-ci.org/emeraldion/creso/jobs/181354791" rel="nofollow noreferrer">UT failures</a> in <a href="https://github.com/emeraldion/creso" rel="nofollow noreferrer">a PHP webapp</a> running in Travis CI against PHP nightly:</p>

<pre><code>$ php --version
PHP 7.2.0-dev (cli) (built: Dec  4 2016 22:49:34) ( ZTS )
</code></pre>

<p>This is the failing test case:</p>

<pre><code>$payments = PaymentsHelper::refunds('DE0000000001', '2016-04-01', '2017-04-01');

$this-&gt;assertNotNull($payments);
$this-&gt;assertEquals(0, count($payments));
</code></pre>

<p>Test failure</p>

<pre><code>1) PaymentsHelperTest::test_refunds_within_lifetime
count(): Parameter must be an array or an object that implements Countable
</code></pre>

<p>The code being tested at the moment contains debug logging showing the return value of <code>refunds()</code> is indeed an Array:</p>

<pre><code>Array
(
    [0] =&gt; Payment Object
        (
...
        )
)
</code></pre>

<p>Am I hitting a bug in PHP nightly?</p>