Skip to content
/ json Public

Json wrapper to provide a more robust API matching PHP 7.3 with exceptions rather than errors.

Notifications You must be signed in to change notification settings

usemarkup/json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Json

Build Status

Json wrapper to provide a more robust API matching PHP 7.3 with exceptions rather than errors.

The following json options are always used

  • JSON_UNESCAPED_UNICODE
  • JSON_BIGINT_AS_STRING
  • JSON_THROW_ON_ERROR

Usage

try {
    $json = '{"a":1}';
    $data = Encoder::decode($json);

    $json = Encoder::encode($data);
} catch (\JsonException $exception) {
    echo $exception->getMessage(); // echoes "Syntax error"
}

Reference

Similar Packages

About

Json wrapper to provide a more robust API matching PHP 7.3 with exceptions rather than errors.

Resources

Stars

Watchers

Forks

Packages

No packages published