- JSON: . Added JSON_THROW_ON_ERROR flag. (Andrea)
if(null === $data = json_decode($json)) throw new Exception();
Better yet - don't use PHP.
if(null === $data = json_decode($json)) throw new Exception();