title: php json_encode is returning 0 , zero value sometimes
body: <p>something is going wrong , im saving json_encode response in mysql db. it sometimes saving <code>0</code> value.im 100% sure that my json_encode function does not receive <code>0</code> as a parameter because it always get empty array or associated array, so there is no any chance to receive <code>0</code> in parameter.</p>
  
  <p>Problem is that why json_encode returns <code>0</code> value sometimes.
  i have column type <code>longtext</code> in db table where im saving its response.
  is it issue with character types? like UTF8 or non UTF8?</p>
  
  <p><strong>Here is a code snippet:</strong></p>
  
  <pre><code>$jsonPayload = [];
  
  if (isset($obj['answer']) &amp;&amp; (!empty($obj['answer']) || $obj['answer'] == 0)) {
         $jsonPayload[$form_fields[$i]-&gt;id] = $obj;         
  }
  
  return json_encode($jsonPayload);
  </code></pre>