summaryrefslogtreecommitdiff
path: root/ext/json/tests/bug66025.phpt
blob: 8f12fa40ca0fa8c4619cedb2e7db5f17c483172b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
--TEST--
Bug #66025 (Indent wrong when json_encode() called from jsonSerialize function)
--FILE--
<?php

class Foo implements JsonSerializable {
    public function jsonSerialize() {
        return json_encode([1], JSON_PRETTY_PRINT);
    }
}

echo json_encode([new Foo]), "\n";
?>
--EXPECT--
["[\n    1\n]"]