xref: /PHP-7.4/ext/json/tests/bug66025.phpt (revision c34de0b6)
1--TEST--
2Bug #66025 (Indent wrong when json_encode() called from jsonSerialize function)
3--SKIPIF--
4<?php
5if (!extension_loaded('json')) die('skip');
6?>
7--FILE--
8<?php
9
10class Foo implements JsonSerializable {
11    public function jsonSerialize() {
12	    return json_encode([1], JSON_PRETTY_PRINT);
13	}
14}
15
16echo json_encode([new Foo]), "\n";
17?>
18--EXPECT--
19["[\n    1\n]"]
20