xref: /PHP-7.4/ext/json/tests/009.phpt (revision c79d5b86)
1--TEST--
2json_encode() with non-packed array that should be encoded as an array rather than object
3--SKIPIF--
4<?php if (!extension_loaded("json")) print "skip"; ?>
5--FILE--
6<?php
7$a = array(1, 2, 3, 'foo' => 'bar');
8unset($a['foo']);
9
10var_dump(json_encode($a));
11echo "Done\n";
12?>
13--EXPECT--
14string(7) "[1,2,3]"
15Done
16
17