This actually looks like a bug in HHVM - `php_strip_whitespace` works correctly with Zend PHP and the XHP extension. Filed as a HHVM bug - https://github.com/facebook/hhvm/issues/2736