File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -69,7 +69,8 @@ var_dump($isValid); // true
6969
7070// Parsing a JSON string. similar to the json_decode() function but without the fourth argument
7171try {
72- $parsedJSON = simdjson_decode($jsonString, true, 512); //return array|object|null. "null" string is not a standard json
72+ // returns array|stdClass|string|float|int|bool|null.
73+ $parsedJSON = simdjson_decode($jsonString, true, 512);
7374 var_dump($parsedJSON); // PHP array
7475} catch (RuntimeException $e) {
7576 echo "Failed to parse $jsonString: {$e->getMessage()}\n";
@@ -140,7 +141,8 @@ function simdjson_is_valid(string $json, int $depth = 512) : bool {}
140141 * @param string $json The JSON string being decoded
141142 * @param string $key The JSON pointer being requested
142143 * @param int $depth The maximum nesting depth of the structure being decoded.
143- * @param bool $throw_if_uncountable If true, then throw SimdJsonException instead of returning 0 for JSON pointers
144+ * @param bool $throw_if_uncountable If true, then throw SimdJsonException instead of
145+ returning 0 for JSON pointers
144146 to values that are neither objects nor arrays.
145147 * @return int
146148 * @throws SimdJsonException for invalid JSON or invalid JSON pointer
You can’t perform that action at this time.
0 commit comments