You forgot `ENT_QUOTES | ENT_SUBSTITUTE` on `htmlspecialchars`, it's perilous to use directly in every single place. But after embracing `short_open_tag` (or `<?=` is always available in 5.4+), foreach, `\PDO::FETCH_OBJ` and a helper function;
<?php foreach($row in $results) { ?>
<div><?=h($row->field)?></div>
<?php } ?>
Is it really longer/worse than the equivalent twig/smarty/handlebars ?