You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @throws RuntimeException for invalid JSON (or document over 4GB, or out of range integer/float)
114
+
*/
115
+
function simdjson_decode(string $json, bool $assoc = false, int $depth = 512) {}
116
+
117
+
/**
118
+
* Returns true if json is valid.
119
+
*
120
+
* @returns ?bool (null if depth is invalid)
121
+
*/
122
+
function simdjson_is_valid(string $json, int $depth = 512) : ?bool {}
123
+
124
+
/**
125
+
* Parses $json and returns the number of keys in $json matching the JSON pointer $key
126
+
*
127
+
* @returns ?bool (null if depth is invalid)
128
+
*/
129
+
function simdjson_key_count(string $json, string $key, int $depth = 512) : ?int {}
130
+
131
+
/**
132
+
* Returns true if the JSON pointer $key could be found.
133
+
*
134
+
* @returns ?bool (null if depth is invalid, false if json is invalid or key is not found)
135
+
*/
136
+
function simdjson_key_exists(string $json, string $key, int $depth = 512) : ?bool {}
137
+
138
+
/**
139
+
* Returns the value at $key
140
+
*
141
+
* @returns array|stdClass|string|float|int|bool|null the value at $key
142
+
* @throws RuntimeException for invalid JSON (or document over 4GB, or out of range integer/float)
143
+
*/
144
+
function simdjson_key_value(string $json, string $key, bool $assoc = unknown, int $depth = unknown) {}
145
+
```
146
+
105
147
## Edge cases
106
148
107
149
There are some differences from `json_decode()` due to the implementation of the underlying simdjson library. This will throw a RuntimeException if simdjson rejects the JSON.
0 commit comments