json_decode()
function json_decode(string $json, ?bool $associative = null, int $depth = 512, int $flags = 0): mixed
Decodes a JSON string.
Parameters:
$json(string)$associative(?bool), defaultnull, optional$depth(int), default512, optional$flags(int), default0, optional
Returns: mixed
Availability
- Compiled (AOT): supported by the Elephc code generator.
eval()(magician interpreter): supported — declarative interpreter builtin (crates/elephc-magician/src/interpreter/builtins/json/json_decode.rs).
No examples yet — check examples/ and showcases/ for usage patterns.
Internals
For how json_decode is implemented in the compiler, see the internals page.