<?php
$array = [0 => "foo", 1 => "bar", 2 => ["baz"]];
$associative = false;
var_dump(
json_decode(
json_encode($array),
$associative
)
);
?>
The above will output
<?php
?>
Considering <?php $associative = false; ?> one might expect
<?php
?>
an stdClass object instead of an array, but this is incorrect.
json_decode will always return an array for a sequentially encoded array, regardless of the ?bool $associative 2nd argument
Which is inline with the above mentioned docs/spec
> Returns the value encoded in json in appropriate PHP type
Considering that the 1st arg was a sequentially encoded array as a json string
'["foo","bar",["baz"]]'