$sections */ public function __construct( public readonly string $title, public readonly array $sections, public readonly string $language = 'en', ) { } public function totalChars(): int { $n = 0; foreach ($this->sections as $s) { $n += mb_strlen($s['text']); } return $n; } }