com php-src: Adds json_encode test for unpacked array s: ext/json/tests/009.phpt
| From: | Nikita Popov | Date: | Mon, 29 Apr 2019 08:23:38 +0000 |
| Subject: | com php-src: Adds json_encode test for unpacked array s: ext/json/tests/009.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-105964@lists.php.net to get a copy of this message | ||
Commit: c79d5b86e005655d10a41d72ff61c33387e88e09
Author: Jury <zeui16@gmail.com> Sun, 28 Apr 2019 22:58:11 -0400
Committer: Nikita Popov <nikita.ppv@gmail.com> Mon, 29 Apr 2019 10:23:38 +0200
Parents: c68dc6b5e37e74d89e0a387079139c054c8faa81
Branches: PHP-7.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c79d5b86e005655d10a41d72ff61c33387e88e09
Log:
Adds json_encode test for unpacked arrays
Changed paths:
A ext/json/tests/009.phpt
Diff:
diff --git a/ext/json/tests/009.phpt b/ext/json/tests/009.phpt
new file mode 100644
index 0000000..2432e38
--- /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
+