title: json_decode returns JSON_ERROR_SYNTAX but online formatter says the JSON is OK
body: <p>I got a very strange problem.</p>
  
  <p>I have a JSON webservice.</p>
  
  <p>When i check it with this website <a href="http://www.freeformatter.com/json-formatter.html#ad-output" rel="noreferrer">http://www.freeformatter.com/json-formatter.html#ad-output</a></p>
  
  <p>Everything is OK.</p>
  
  <p>But when i load my JSON with this code :</p>
  
  <pre><code>  $data = file_get_contents('http://www.mywebservice');
  
  if(!empty($data))
  {
  
      $obj = json_decode($data);
  
   switch (json_last_error()) {
      case JSON_ERROR_NONE:
          echo ' - JSON_ERROR_NONE';
      break;
      case JSON_ERROR_DEPTH:
          echo ' - JSON_ERROR_DEPTH';
      break;
      case JSON_ERROR_STATE_MISMATCH:
          echo ' - JSON_ERROR_STATE_MISMATCH';
      break;
      case JSON_ERROR_CTRL_CHAR:
          echo ' -  JSON_ERROR_CTRL_CHAR';
      break;
      case JSON_ERROR_SYNTAX:
          echo "\r\n\r\n - SYNTAX ERROR \r\n\r\n";
      break;
      case JSON_ERROR_UTF8:
          echo ' - JSON_ERROR_UTF8';
      break;
      default:
          echo ' - Unknown erro';
      break;
  }
  </code></pre>
  
  <p>I got the error : SYNTAX ERROR</p>
  
  <p>WHICH IS NOT HELP FULL AT ALL.</p>
  
  <p>It is a nightmare.    </p>
  
  <p>I see that with PHP 5.5 i could use this function : <a href="http://php.net/manual/en/function.json-last-error-msg.php" rel="noreferrer">http://php.net/manual/en/function.json-last-error-msg.php</a></p>
  
  <p>(but i did not succeed to install PHP 5.5 yet, and i m not sure this function will give me more detail)</p>