public function to_json() { $posts = array_map(function (Post $e) { return $e->to_json(); }, $this->getArrayCopy()); return '[' . implode(',', $posts) . ']'; }