Hacker News new | ask | show | jobs
by LeonM 2938 days ago
Absolutely, before you had to do some check like:

if(null === $data = json_decode($json)) throw new Exception();

1 comments

Wrong! "null" is a valid JSON-serialized value! You MUST call json_last_error.

Better yet - don't use PHP.