Use Heredoc or just output HTML?

Though, consider this alternative “template inheritance” style.

<?php $title = 'My Web Page' ?>

<?php ob_start() ?>
    <h1>Hello</h1>
    <p>Hello, World!</p>
<?php $content = ob_get_clean() ?>

<?php require 'layout.php' ?>
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title><?php echo $title ?></title>
  </head>
  <body>
      <?php echo $content ?>
  </body>
</html>