Hi,
I use PHP7 on my installs, so I wanted to get it working. It's been a headache, and all I've done is work around the issue.
The issue is that, for some reason, the json_encode call in the JsonResponse::jsonEncode method for the api call to get the user document is throwing a parse error.
This is strange, because if you add the JSON_PARTIAL_OUTPUT_ON_ERROR flag, it works fine (I checked, adding that flag gives the same output as PHP 5.6, bar the json syntax error).
I have a right mind to say this is a PHP bug... But I can't figure out a minimal code sample to reproduce, so it may not be a PHP bug...
Either way, changing the method to this lets me run it on PHP7 (for now at least):
private function jsonEncode($data, $encodingOptions)
{
if (is_resource($data)) {
throw new InvalidArgumentException('Cannot JSON encode resources');
}
// Clear json_last_error()
json_encode(null);
$json = json_encode($data, $encodingOptions | JSON_PARTIAL_OUTPUT_ON_ERROR);
json_encode(null);
if (JSON_ERROR_NONE !== json_last_error()) {
throw new InvalidArgumentException(sprintf(
'Unable to encode data to JSON in %s: %s',
__CLASS__,
json_last_error_msg()
));
}
return $json;
}