bug66025.phpt 316 B

123456789101112131415
  1. --TEST--
  2. Bug #66025 (Indent wrong when json_encode() called from jsonSerialize function)
  3. --FILE--
  4. <?php
  5. class Foo implements JsonSerializable {
  6. public function jsonSerialize(): mixed {
  7. return json_encode([1], JSON_PRETTY_PRINT);
  8. }
  9. }
  10. echo json_encode([new Foo]), "\n";
  11. ?>
  12. --EXPECT--
  13. ["[\n 1\n]"]