One-page with kirby 3 stuck just in the beginning

i want to build the one-page, like in the Cookbook. but just in the beginning i get trouble with the syntax.

i get invalid arguments for foreach()

1. <?php
2. snippet('header');
3. foreach($pages->visible() as $section) {
4. snippet($section->uid(), array('data' => $section));
5. }
6. snippet('footer');
7. ?>

the subpage.php in snippets contains simple things like:

<h1 class=section-title><?php echo $data->title()->html() ?></h1>
<?php echo $data->text()->kirbytext() ?>

i tried with version 3.5.5

Where did you find visible() in the documentation? visible() is deprecated, use listed() instead.

aah thanks a lot. it seems that i copied kirby2 stuff in some cases.
now i am a bit further. wow.