}, { "identifier": 20, "username": "John" }, { "identifier": 50, "username": "Smith" } ] }, "allow_out_of_range_pages": false, "normalize_out_of_range_pages": false, "max_per_page": 2, "current_page": 1 } $users = [ new User(1, 'AdrienBrault'), new User(20, 'John'), new User(50, 'Smith') ]; $pager = new Pagerfanta\Pagerfanta(new Pagerfanta\Adapter\ArrayAdapter($users)); $pager->setMaxPerPage(2); echo $serializer->serialize($pager, 'json'); Well ... Serialization of a Pagerfanta instance 20