I think the derivations of “XH” in “XHProf” and “XHPAST” are different, although I’m not entirely sure. I believe the origins are:
“XHP” was a Facebook project that added syntax to PHP to support inline XML. I believe the name was just a mashup of “XML + PHP”, and didn’t specifically stand for anything. I contributed a little bit to XHP but only had a very minor hand in it.
“XHPAST” was derived technically from “XHP”, since I originally just copy/pasted the XHP parser/lexer. The original name just meant “XHP Abstract Syntax Tree”, and the syntax it parsed was “XHP” syntax (i.e., PHP + inline XML literals). I was the primary author of the AST stuff, so I’m fairly confident I’m remembering this correctly.
Modern “XHPAST” no longer parses XHP – it parses vanilla PHP instead – so the name is now a misnomer. I’ve gradually been realigning it to “PHPAST” (PHP Abstract Syntax Tree) and “AAST” (Abstract Abstract Syntax Tree, i.e. a general-purpose language-agnostic toolset for handling ASTs / incredibly clever joke).
I think “XHProf” may originally have been called “PHProf”? There’s a project derived from it called “PHProf” now, so I might be misremembering this. In either case, the “…HProf” part stands for “Hierarchical Profiler”. I’m not sure where the “X” came from or when it was introduced. It’s possible it stands for “XHP”, but this seems unlikely to me – XHProf predated XHP and there would have been no need to rewrite or rename it after the introduction of XHP.
Separately, “HPHP” (later “HHVM”, then “Hack”) was “High Performance PHP” and didn’t have a direct technical relationship to “XHP” or “XHProf”, except that it eventually needed to implement their functionality natively, I believe.