{"id":301133,"date":"2010-02-10T02:13:43","date_gmt":"2010-02-10T07:13:43","guid":{"rendered":"http:\/\/www.readwriteweb.com\/archives\/xhp_more_php_enhancement_from_facebook.php"},"modified":"2010-02-10T02:13:43","modified_gmt":"2010-02-10T07:13:43","slug":"facebook-debuts-xhp-more-php-enhancement","status":"publish","type":"post","link":"https:\/\/mereja.media\/index\/301133","title":{"rendered":"Facebook Debuts XHP: More PHP Enhancement"},"content":{"rendered":"<p><img decoding=\"async\" src=\"http:\/\/www.readwriteweb.com\/jolie-facebook-logo.png\">Last week, we were <a href=\"http:\/\/www.readwriteweb.com\/tag\/hiphop\">chasing our tails in giddiness<\/a> over HipHop, a newly open-sourced PHP runtime developed in house at Facebook.<\/p>\n<p>Today, amid the <a href=\"http:\/\/www.readwriteweb.com\/tag\/buzz\">rabid excitement<\/a> over Google Buzz, Facebook quietly pumped some more code into the world. <a href=\"http:\/\/www.facebook.com\/notes\/facebook-engineering\/xhp-a-new-way-to-write-php\/294003943919\">XHP<\/a> is a new way to write PHP that &#8220;augments the syntax of the language to both make your front-end code easier to understand and help you avoid cross-site scripting attacks,&#8221; according to Facebook engineer Marcel Laverdet. <font style=\"float: right; margin-left: 10px;\"><script type=\"text\/javascript\">tweetmeme_url = 'http:\/\/www.readwriteweb.com\/archives\/xhp_more_php_enhancement_from_facebook.php';tweetmeme_source = 'rww';<\/script><script type=\"text\/javascript\" src=\"http:\/\/tweetmeme.com\/i\/scripts\/button.js\"><\/script><\/font>&#8220;XHP has enabled us to build better websites faster; our Lite site was written entirely with XHP.&#8221;<\/p>\n<p>Here&#8217;s what a few developers, including PHP creator Rasmus Lerdorf, had to say about it.<\/p>\n<p align=\"right\"><em>Sponsor<\/em><br \/><a href='http:\/\/d.ads.readwriteweb.com\/ck.php?n=18194&amp;cb=18194' ><img src='http:\/\/d.ads.readwriteweb.com\/avw.php?zoneid=14&amp;cb=18194&amp;n=18194' border='0' alt='' \/><\/a><\/p>\n<p>Lerdorf <a href=\"http:\/\/toys.lerdorf.com\/archives\/54-A-quick-look-at-XHP.html\">describes XHP<\/a> as &#8220;a new PHP extension today that supports inlining XML&#8230; It adds an extra parsing step which maps inlined XML element to PHP classes.<\/p>\n<p>&#8220;The main interest, at least to me, is that because PHP now understands XML it is outputting, filtering can be done in a context-sensitive manner.&#8221;<\/p>\n<p>He also comments on XHP&#8217;s significant performance issues and speculates how XHP would work specifically at Facebook.<\/p>\n<p>&#8220;Running XHP on plain PHP is definitely out of the question. But, knowing that Facebook uses APC [alternative PHP cache] heavily and looking through the code (see the MINIT function in ext.cpp) we can see that it should play nicely with APC&#8230; So, when you combine XHP with HipHop PHP you can start to imagine that the performance penalty would be a lot less than 75% and it becomes a viable approach.&#8221;<\/p>\n<p>Meanwhile, over at <a href=\"http:\/\/news.ycombinator.com\/item?id=1113832\">Hacker News<\/a>, <a href=\"http:\/\/www.wikispaces.com\">Wikispaces<\/a> creator <a href=\"http:\/\/jbyers.com\/html\/\">James Byers<\/a> <a href=\"http:\/\/news.ycombinator.com\/item?id=1114015\">writes<\/a>, &#8220;For me, XHP is far more interesting than HipHop. And I say that as someone who administers a pile of single-application CPU-bound PHP servers. This completely and forever changes the templates-vs-just-PHP debate, and I&#8217;m glad &#8211; it&#8217;s the kind of evolution PHP needs to continue to be taken seriously.&#8221;<\/p>\n<p><a href=\"http:\/\/tipjoy.com\/\">Tipjoy<\/a> co-founder and current Facebook engineer <a href=\"http:\/\/kirigin.com\">Ivan Kirigin<\/a> also chimes in with strong praise, <a href=\"http:\/\/news.ycombinator.com\/item?id=1113854\">saying<\/a>, &#8220;XHP rocks so [expletive deleted] hard, it isn&#8217;t even funny. It is just so much better than alternatives.<\/p>\n<p>&#8220;IMHO, It is the only PHP tool I use at Facebook that is better than alternatives in other languages. I&#8217;m looking at you, Django templates! The notation perfectly represents the objects, with no cruft associated with object oriented programming. That is really rare.&#8221;<\/p>\n<p>Here&#8217;s <a href=\"http:\/\/github.com\/facebook\/xhp\/\">XHP on GitHub<\/a>, and here&#8217;s the <a href=\"http:\/\/github.com\/facebook\/xhp\">documentation wiki<\/a>. Take a look, and let us know what you think in the comments!<\/p>\n<p><strong><a href=\"http:\/\/www.readwriteweb.com\/archives\/xhp_more_php_enhancement_from_facebook.php#comments-open\">Discuss<\/a><\/strong><\/p>\n<p><a href=\"http:\/\/feedads.g.doubleclick.net\/~at\/vm-m2LfAYOcdQ4VxqkyDIdnEaFo\/0\/da\"><img decoding=\"async\" src=\"http:\/\/feedads.g.doubleclick.net\/~at\/vm-m2LfAYOcdQ4VxqkyDIdnEaFo\/0\/di\" border=\"0\" ismap=\"true\"><\/img><\/a><br \/>\n<a href=\"http:\/\/feedads.g.doubleclick.net\/~at\/vm-m2LfAYOcdQ4VxqkyDIdnEaFo\/1\/da\"><img decoding=\"async\" src=\"http:\/\/feedads.g.doubleclick.net\/~at\/vm-m2LfAYOcdQ4VxqkyDIdnEaFo\/1\/di\" border=\"0\" ismap=\"true\"><\/img><\/a><\/p>\n<div class=\"feedflare\">\n<a href=\"http:\/\/feeds.feedburner.com\/~ff\/readwriteweb?a=HWecjiP5Snc:B0lXC9tiKJA:FFnlKYwJmN0\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/readwriteweb?d=FFnlKYwJmN0\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/readwriteweb?a=HWecjiP5Snc:B0lXC9tiKJA:Ij26kaj3iuU\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/readwriteweb?d=Ij26kaj3iuU\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/readwriteweb?a=HWecjiP5Snc:B0lXC9tiKJA:C2pbw5bZMiI\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/readwriteweb?d=C2pbw5bZMiI\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/readwriteweb?a=HWecjiP5Snc:B0lXC9tiKJA:yIl2AUoC8zA\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/readwriteweb?d=yIl2AUoC8zA\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/readwriteweb?a=HWecjiP5Snc:B0lXC9tiKJA:V_sGLiPBpWU\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/readwriteweb?i=HWecjiP5Snc:B0lXC9tiKJA:V_sGLiPBpWU\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/readwriteweb?a=HWecjiP5Snc:B0lXC9tiKJA:gIN9vFwOqvQ\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/readwriteweb?i=HWecjiP5Snc:B0lXC9tiKJA:gIN9vFwOqvQ\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/readwriteweb?a=HWecjiP5Snc:B0lXC9tiKJA:F7zBnMyn0Lo\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/readwriteweb?i=HWecjiP5Snc:B0lXC9tiKJA:F7zBnMyn0Lo\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/readwriteweb?a=HWecjiP5Snc:B0lXC9tiKJA:OqabYuBsmOY\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/readwriteweb?d=OqabYuBsmOY\" border=\"0\"><\/img><\/a>\n<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~r\/readwriteweb\/~4\/HWecjiP5Snc\" height=\"1\" width=\"1\"\/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Last week, we were chasing our tails in giddiness over HipHop, a newly open-sourced PHP runtime developed in house at Facebook. Today, amid the rabid excitement over Google Buzz, Facebook quietly pumped some more code into the world. XHP is a new way to write PHP that &#8220;augments the syntax of the language to both [&hellip;]<\/p>\n","protected":false},"author":553,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-301133","post","type-post","status-publish","format-standard","hentry","category-news"],"_links":{"self":[{"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/posts\/301133","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/users\/553"}],"replies":[{"embeddable":true,"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/comments?post=301133"}],"version-history":[{"count":0,"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/posts\/301133\/revisions"}],"wp:attachment":[{"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/media?parent=301133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/categories?post=301133"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/tags?post=301133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}