source: src/router/php7/ext/json/tests/bug66025.phpt @ 31874

Last change on this file since 31874 was 31874, checked in by brainslayer, 6 weeks ago

update php

File size: 367 bytes
Line 
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]"]
Note: See TracBrowser for help on using the repository browser.