If we json_encode an array which has Inf or NaN then we get : Inf and NaN cannot be JSON encoded
The workaround as mentioned here - https://levels.io/inf-nan-json_encode/ is :
json_encode(unserialize(str_replace(array('NAN;','INF;'),'0;',serialize($reply))));
Is there any update on getting this resolved better using the latest PHP versions, say 8.0 or 8.1 ?