|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
[2015-02-13 01:45 UTC] encryptio at gmail dot com
[2016-05-15 14:53 UTC] bukka@php.net
-Assigned To:
+Assigned To: bukka
[2016-05-15 14:53 UTC] bukka@php.net
[2016-10-30 13:29 UTC] bukka@php.net
[2016-10-30 13:29 UTC] bukka@php.net
-Status: Assigned
+Status: Closed
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 22:00:01 2025 UTC |
Description: ------------ This is because the current indent is stored in a variable JSON_G(encoder_depth), which is shared between json_encode() calls. Test script: --------------- <?php class Foo implements JsonSerializable { public function jsonSerialize() { return json_encode([1], JSON_PRETTY_PRINT); } } echo json_encode([new Foo]), "\n"; Expected result: ---------------- ["[\n 1\n]"] Actual result: -------------- ["[\n 1\n ]"]