1<?php
2
3function json_validate_trycatchdump($json, $depth = 512, $flags = 0) {
4    try {
5        var_dump(json_validate($json, $depth, $flags));
6    } catch (JsonException $e) {
7        echo "JsonException: {$e->getCode()} {$e->getMessage()}". PHP_EOL;
8    } catch (Exception $e) {
9        echo "Exception: {$e->getCode()} {$e->getMessage()}". PHP_EOL;
10    } catch (Error $e) {
11        echo "Error: {$e->getCode()} {$e->getMessage()}". PHP_EOL;
12    }
13
14    var_dump(json_last_error(), json_last_error_msg());
15}
16
17?>
18