summaryrefslogtreecommitdiff
path: root/ext/json/tests
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2014-04-13 18:50:39 -0700
committerStanislav Malyshev <stas@php.net>2014-04-13 18:50:39 -0700
commit5e66ce929350b98003becd362464d47e8f49c8fb (patch)
tree69da0092e11c13e3b5677845d6acf1ce06650547 /ext/json/tests
parentb05c088a3abf8e4c6fb6e40418423a9e2dd3d929 (diff)
parent82a4f1a1a287d9dbf01156bc14ceb13ccbf16d7a (diff)
downloadphp-git-5e66ce929350b98003becd362464d47e8f49c8fb.tar.gz
Merge branch 'pull-request/518' into PHP-5.4
* pull-request/518: Fix #66021 (Blank line inside empty array/object)
Diffstat (limited to 'ext/json/tests')
-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--
+[
+ [],
+ {},
+ {}
+]