summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/json/tests/009.phpt16
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
+