<s>
XHP	B-Language
is	O
an	O
augmentation	O
of	O
PHP	B-Application
and	O
Hack	B-Language
developed	O
at	O
Meta	O
(	O
formerly	O
known	O
as	O
Facebook	O
)	O
to	O
allow	O
XML	B-Protocol
syntax	O
for	O
the	O
purpose	O
of	O
creating	O
custom	O
and	O
reusable	O
HTML	B-Language
elements	O
.	O
</s>
<s>
It	O
is	O
available	O
as	O
an	O
open-source	B-Application
software	I-Application
GitHub	B-Application
project	O
and	O
as	O
a	O
Homebrew	B-Application
module	O
for	O
PHP	B-Application
5.3	O
,	O
5.4	O
,	O
and	O
5.5	O
.	O
</s>
<s>
Meta	O
also	O
developed	O
a	O
similar	O
augmentation	O
for	O
JavaScript	B-Language
,	O
named	O
JSX	B-Language
.	O
</s>
<s>
XHP	B-Language
was	O
loosely	O
inspired	O
by	O
ECMAScript	B-Language
for	I-Language
XML	I-Language
and	O
created	O
by	O
Marcel	O
Laverdet	O
.	O
</s>
<s>
It	O
was	O
first	O
developed	O
for	O
Facebook	O
Lite	O
as	O
a	O
new	O
UI	O
rendering	O
layer	O
but	O
was	O
later	O
ported	O
over	O
to	O
Facebook	O
's	O
www	O
and	O
mobile	O
web	O
stack	O
as	O
well	O
as	O
incorporated	O
into	O
HipHop	B-Language
for	I-Language
PHP	I-Language
.	O
</s>
<s>
It	O
was	O
made	O
available	O
to	O
the	O
public	O
in	O
February	O
2010	O
and	O
until	O
2020	O
accounted	O
for	O
nearly	O
all	O
of	O
Facebook	O
app	O
's	O
server-side	O
generated	O
HTML	B-Language
.	O
</s>
<s>
In	O
2020	O
,	O
Facebook	O
redesigned	O
its	O
primary	O
web	O
app	O
to	O
run	O
mostly	O
on	O
React	B-Application
components	O
,	O
rendered	O
both	O
server	O
and	O
client-side	O
.	O
</s>
<s>
XHP	B-Language
is	O
still	O
used	O
in	O
parts	O
of	O
Facebook	O
but	O
is	O
a	O
legacy	O
technology	O
now	O
being	O
phased	O
out	O
.	O
</s>
<s>
XHP	B-Language
offers	O
a	O
much	O
cleaner	O
interface	O
to	O
UI	O
programming	O
when	O
outputting	O
HTML	B-Language
in	O
PHP	B-Application
,	O
but	O
has	O
some	O
engineering	O
advantages	O
as	O
well	O
.	O
</s>
<s>
Parse-time	O
validation	O
of	O
HTML	B-Language
syntax	I-Language
XHP	B-Language
validates	O
the	O
syntax	O
and	O
structure	O
of	O
the	O
entire	O
document	O
tree	O
on	O
render	O
and	O
will	O
throw	O
an	O
exception	O
if	O
an	O
element	O
was	O
not	O
closed	O
properly	O
,	O
has	O
invalid	O
children	O
,	O
has	O
an	O
invalid	O
attribute	O
,	O
or	O
is	O
missing	O
required	O
children	O
or	O
attributes	O
.	O
</s>
<s>
Automatic	O
XSS	O
protection	O
Because	O
all	O
rendering	O
to	O
the	O
page	O
is	O
done	O
inside	O
XHP	B-Language
,	O
and	O
it	O
knows	O
what	O
is	O
HTML	B-Language
and	O
what	O
is	O
content	O
,	O
XHP	B-Language
escapes	O
all	O
content	O
without	O
any	O
special	O
effort	O
from	O
the	O
programmer	O
.	O
</s>
<s>
Object	O
mutation	O
XHP	B-Language
objects	O
are	O
stored	O
as	O
standard	O
PHP	B-Application
objects	O
,	O
so	O
they	O
can	O
be	O
manipulated	O
through	O
a	O
DOM-like	O
API	O
,	O
which	O
includes	O
methods	O
such	O
as	O
setAttribute( )	O
,	O
getAttribute( )	O
,	O
appendChild( )	O
,	O
and	O
several	O
others	O
prior	O
to	O
or	O
during	O
render	O
.	O
</s>
<s>
Custom	O
HTML	B-Language
Instead	O
of	O
writing	O
functions	O
to	O
generate	O
HTML	B-Language
,	O
or	O
switching	O
in	O
and	O
out	O
of	O
PHP	B-Application
,	O
custom	O
XHP	B-Language
elements	O
can	O
be	O
defined	O
and	O
mixed	O
in	O
with	O
standard	O
HTML	B-Language
elements	O
that	O
will	O
abstract	O
out	O
common	O
HTML	B-Language
structures	O
.	O
</s>
