I'm trying to upgrade one of my PHP apps to PHP7. Everything is working great, except one. I see that json_last_error() returns a different value in PHP7.
$input = file_get_contents('php://input');
$json = json_decode($input, true);
print_r(json_last_error());
When I make
curl 'http://localhost/test.php' -H 'Content-Type: application/json' --compressed
PHP 5 returns 0 (JSON_ERROR_NONE)
PHP 7 returns 4 (JSON_ERROR_SYNTAX)
I've looked at the official documentation if there was change, but I could not find any info.
Was there a change for either json_decode() or json_last_error() function?