PHP changelog states that automatically converting an array to an object in json encode has been removed/fixed to not do so anymore at version 7.
Is there some of your code that uses the function ‘json_encode’ and if so, can I change it so it casts the array being fed as a parameter to an object, e.g.:
If it was:
$json = json_encode($data);
Change it to:
$json = json_encode((object) $data);
Hi
We have upgraded our site to PHP 7.2.5 and we are now getting the following error when trying to make a payment on our site:
Payment error: Error parsing json, please check json request
PHP changelog states that automatically converting an array to an object in json encode has been removed/fixed to not do so anymore at version 7.
Is there some of your code that uses the function ‘json_encode’ and if so, can I change it so it casts the array being fed as a parameter to an object, e.g.:
If it was: $json = json_encode($data); Change it to: $json = json_encode((object) $data);
Any assistance would be greatly appreciated.
Best wishes