<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Tue, 18 Jun 2013 16:27:39 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Community News: XHP Released by Facebook (XML in PHP)]]></title>
      <guid>http://www.phpdeveloper.org/news/14004</guid>
      <link>http://www.phpdeveloper.org/news/14004</link>
      <description><![CDATA[<p>
Even before they've release the source for their <a href="http://github.com/facebook/hiphop-php">much hyped HipHop PHP</a> tool, <a href="http://facebook.com">Facebook</a> has slipped another tool in under the radar and have already released it in github - <a href="http://github.com/facebook/xhp/">XHP</a>.
</p>
<p>
On the <a href="http://www.facebook.com/notes/facebook-engineering/xhp-a-new-way-to-write-php/294003943919">official announcement</a> they describe what the tool is and what it can do for you:
</p>
<blockquote>
XHP is a PHP extension which augments the syntax of the language to both make your front-end code easier to understand and help you avoid <a href="http://en.wikipedia.org/wiki/Cross-site_scripting">cross-site scripting</a> attacks. <a href="http://github.com/facebook/xhp/">XHP</a> does this by making PHP understand XML document fragments, similar to what E4X does for ECMAScript (JavaScript). While PHP is typically used to write front-end code, by itself it isn't a very good language for generating HTML (as evidenced by the popularity of templating engines like Smarty). XHP is something between a programmatic UI library and a full templating system
</blockquote>
<p>
<i>Rasmus Lerdorf</i> took the opportunity to play with this new tool and run some benchmarks on its performance in a more real situation than the form example Facebook gave:
</p>
<blockquote>
The real question here is what is this runtime xml validation going to cost you.  [...] Note that to build XHP you will need flex 2.5.35 which most distros won't have installed by default. Grab the <a href="http://prdownloads.sourceforge.net/flex/flex-2.5.35.tar.gz?download">flex tarball</a> and ./configure && make install it. Then you are ready to go. 
</blockquote>
<p>
He created a simple class (a "singleton") and ran some benchmarks against it with <a href="http://www.joedog.org/index/siege-home">Siege</a>. I won't share the results of those benchmarks here, though - you'll need to visit <a href="http://toys.lerdorf.com/archives/54-A-quick-look-at-XHP.html">Rasmus' site</a> for those (but here's a hint, the future's not bright).
</p>]]></description>
      <pubDate>Wed, 10 Feb 2010 15:10:23 -0600</pubDate>
    </item>
  </channel>
</rss>
