diff options
| author | Jury <zeui16@gmail.com> | 2019-04-28 22:58:11 -0400 |
|---|---|---|
| committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-04-29 10:23:38 +0200 |
| commit | c79d5b86e005655d10a41d72ff61c33387e88e09 (patch) | |
| tree | 6a76908fff9eb6bb845d59c2f7bb802682645786 | |
| parent | c68dc6b5e37e74d89e0a387079139c054c8faa81 (diff) | |
| download | php-git-c79d5b86e005655d10a41d72ff61c33387e88e09.tar.gz | |
Adds json_encode test for unpacked arrays
| -rw-r--r-- | ext/json/tests/009.phpt | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ext/json/tests/009.phpt b/ext/json/tests/009.phpt new file mode 100644 index 0000000000..2432e386f5 --- /dev/null +++ b/ext/json/tests/009.phpt @@ -0,0 +1,16 @@ +--TEST-- +json_encode() with non-packed array that should be encoded as an array rather than object +--SKIPIF-- +<?php if (!extension_loaded("json")) print "skip"; ?> +--FILE-- +<?php +$a = array(1, 2, 3, 'foo' => 'bar'); +unset($a['foo']); + +var_dump(json_encode($a)); +echo "Done\n"; +?> +--EXPECT-- +string(7) "[1,2,3]" +Done + |
