xref: /PHP-7.2/ext/json/tests/bug73254.phpt (revision c34de0b6)
1--TEST--
2Bug #73254 (Incorrect indentation generated by json_encode() with JSON_PRETTY_PRINT)
3--SKIPIF--
4<?php
5if (!extension_loaded('json')) die('skip');
6?>
7--FILE--
8<?php
9
10echo json_encode([json_encode([1], JSON_PRETTY_PRINT)]), "\n";
11
12$fp = fopen('php://temp', 'r');
13$data = ['a' => $fp];
14echo json_encode($data), "\n";
15echo json_encode([json_encode([1], JSON_PRETTY_PRINT)]), "\n";
16
17?>
18--EXPECT--
19["[\n    1\n]"]
20
21["[\n    1\n]"]
22