<?php foreach($x as $y): ?> <h1><?= $y->title ?></h1> <?php endforeach; ?>
<? foreach($x as $y): ?> <h1><?= h($y->title) ?></h1> <? endforeach ?>