4 ms·
Absolutely, before you had to do some check like: if(null === $data = json_decode($json)) throw new Exception();
by LeonM 8y ago
Absolutely, before you had to do some check like:
if(null === $data = json_decode($json)) throw new Exception();
- rollcat 8y agoWrong! "null" is a valid JSON-serialized value! You MUST call json_last_error. Better yet - don't use PHP.