Rasmus Lerdorf's analysis of XHP
toys.lerdorf.com
toys.lerdorf.com
return $this->renderBaseAttrs() . ' />';
No wonder it's expensive. If you serialize a tree of objects by concatenating subtrees into substrings, most values are copied many times depending on the depth of the tree, and you end up doing O(n log n) work. But as for the alternative there was basic XSS filtering in place for the naked
$_POST['name'] variable in the plain PHP version
isn't knowing you have to encode some but not all of your output worse than just encoding all of it? This is the kind of design mistake that leads to databases accidentally full of HTML entities. Or more likely, half full.Not that I regard PHP a particularly HL language
Going from one HLL to another if you never plan to look at or change the generated code is significantly easier than going to machine code. Just look at all the compilers that target C.
HPHP's 50% speed boost does not make up for a templating engine that 43 times slower.
Being 43 times slower is going to make a noticeable impact on latency especially when the templates are likely to be larger than the example shown.
The impact of XHP and HPHP depend very much on what you are doing to serve your requests.