The JsonSerializable interface

(PHP 5 >= 5.4.0, PHP 7, PHP 8)

Вступ

Objects implementing JsonSerializable can customize their JSON representation when encoded with json_encode().

Короткий огляд iнтерфейcу

interface JsonSerializable {
/* Методи */
public jsonSerialize(): mixed
}

Зміст