Parser
The PHP parser is a piece of software that processes a piece of text and extracts tokens, with their PHP meanings. The tokens are atomic pieces of information, that are grouped later to build a larger message.
PHP includes an internal parser, that reads the source code, and produces the PHP tokens, the AST and later, the opcodes.
<?php
if (!json_validate($json)) {
throw new Exception('invalid JSON data');
}
$object = json_decode($json);
?>