-
-
Notifications
You must be signed in to change notification settings - Fork 13
Closed
Labels
Description
Parse json5 codes always thorw JsonException on set JSON_THROW_ON_ERROR
Detailed description
Lines 75 to 80 in 7b4e50c
if (PHP_VERSION_ID >= 70000) { | |
$result = \json_decode($source, $associative, $depth, $options); | |
if (\json_last_error() === \JSON_ERROR_NONE) { | |
return $result; | |
} | |
} |
in the code L76, if php version > 7.0 and set option JSON_THROW_ON_ERROR.
always thorw JsonException and interrupt subsequent processing
Your environment
Include as many relevant details about the environment you experienced the bug in and how to reproduce it.
- Library version used (e.g. 1.0)
- PHP version used (e.g. PHP 5.6, PHP 7.0): PHP 7.0+
- Operating system and version (e.g. Ubuntu 16.04, Windows 7):
I think should auto remove JSON_THROW_ON_ERROR option on php > 7.0 in:
if (PHP_VERSION_ID >= 70000) {
// auto remove JSON_THROW_ON_ERROR option before call json_decode()
}