Skip to content

Instantly share code, notes, and snippets.

@jonnybarnes
Created September 11, 2018 20:03
Show Gist options
  • Select an option

  • Save jonnybarnes/84f829c7e2a2e5e4562db0f9f57cc33d to your computer and use it in GitHub Desktop.

Select an option

Save jonnybarnes/84f829c7e2a2e5e4562db0f9f57cc33d to your computer and use it in GitHub Desktop.

Revisions

  1. jonnybarnes created this gist Sep 11, 2018.
    7 changes: 7 additions & 0 deletions jsonexception.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    <?php

    try {
    json_decode('{invalid{json', false, 512, JSON_THROW_ON_ERROR);
    } catch (\JSONException $exception) {
    MyLogger::error($exception->getMessage());
    }