What does JSON_ERROR_RECURSION mean from json_encode?
<p>I get this error on PHP7 every about 100 requests for some odd reason and I cannot get rid of it until I restart the fpm demon, however, the real problem is I cannot explain what the error is to start diagnosing this.</p>

<p>I took a look at the documentation <a href="http://php.net/manual/en/function.json-last-error.php" rel="nofollow">http://php.net/manual/en/function.json-last-error.php</a> which was not very useful and there does not seem to be any real links hanging about.</p>

<p>I know this error is not actually related to recursion depth (<code>JSON_ERROR_DEPTH</code>) so what does this error actually mean?</p>

<p>This is the <code>var_dump()</code> of the array that is failing:</p>

<pre><code> array (
'ns' =&gt; 'user',
'where' =&gt; '{"_id":"MongoDB\\\\BSON\\\\ObjectID(5505a4f647ac1824618b4567)","status":10}',
'projection' =&gt;
array (
),
'sort' =&gt;
array (
),
'limit' =&gt; NULL,
'skip' =&gt; NULL,
)
</code></pre>