MicroHTML
Moving from Hack to vanilla PHP, I miss XHP T__T
This isn't XHP, but it does provide a minimum-bullshit method of generating HTML
use function MicroHTML\{HTML,SECTION,H1,P,DIV};
$page = HTML(
SECTION(["id"=>"news"],
H1("My title"),
P("Here's some content")
)
);
$page->appendChild(
SECTION(["id"=>"comments"],
DIV("Oh noes: <script>alert('a haxxor is attacking us');</script>")
)
);
print($page);
<html>
<section id='news'>
<h1>My title</h1>
<p>Here's some content</p>
</section>
<section id='comments'>
<div>Oh noes: <script>alert('a haxxor is attacking us');</script></div>
</section>
</html>