TIL that json_decode() returns NULL if the json is malformed.