« simdjson_is_valid
simdjson_key_exists »

simdjson_key_count

(PECL simdjson >= 2.0.0)

simdjson_key_count — Returns the value at a JSON pointer.

説明

function simdjson_key_count(
    string $json,
    string $key,
    int $depth = 512,
    bool $throw_if_uncountable = false
): int

Count the number of elements of the object/array found at the requested JSON pointer.

パラメータ

json

The json string being queried.

key

The JSON pointer string.

depth

Maximum nesting depth of the structure being validated. The value must be greater than 0, and less than or equal to 2147483647. Callers should use reasonably small values, because larger depths require more buffer space and will increase the recursion depth, unlike the current json_decode() implementation.

throw_if_uncountable

When true, a SimdJsonException will be thrown instead of returning 0 when the value the JSON pointer points to is neither an object nor an array.

戻り値

Returns an int with the number of elements of the value at the given JSON pointer.

関連キーワード:
pointer   simdjson   json   depth   count   throw   uncountable   number   elements   valid   exists   Simdjson   Count   found   requested   queried   Maximum   nesting   structure   validated   greater   less   equal   Callers   reasonably
関連する関数・ページ:
function.simdjson-key-exists   function.simdjson-key-value   ref.simdjson   book.simdjson   function.simdjson-is-valid   function.simdjson-decode