<?php class Foo implements JsonSerializable { public function jsonSerialize() { return json_encode([1], JSON_PRETTY_PRINT); } } echo json_encode([new Foo]), "\n";
You have javascript disabled. You will not be able to edit any code.