summaryrefslogtreecommitdiff
path: root/ext/json/tests/bug66021.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/json/tests/bug66021.phpt')
-rw-r--r--ext/json/tests/bug66021.phpt20
1 files changed, 20 insertions, 0 deletions
diff --git a/ext/json/tests/bug66021.phpt b/ext/json/tests/bug66021.phpt
new file mode 100644
index 0000000000..cf52e0c6df
--- /dev/null
+++ b/ext/json/tests/bug66021.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Bug #66021 (Blank line inside empty array/object when JSON_PRETTY_PRINT is set)
+--SKIPIF--
+<?php if (!extension_loaded("json")) print "skip"; ?>
+--FILE--
+<?php
+
+class Foo {
+ private $bar = 'baz';
+}
+
+echo json_encode([[], (object)[], new Foo], JSON_PRETTY_PRINT), "\n";
+
+?>
+--EXPECT--
+[
+ [],
+ {},
+ {}
+]