<s>
PHP	B-Application
is	O
a	O
general-purpose	B-Language
scripting	B-Language
language	I-Language
geared	O
toward	O
web	O
development	O
.	O
</s>
<s>
It	O
was	O
originally	O
created	O
by	O
Danish-Canadian	O
programmer	B-Application
Rasmus	O
Lerdorf	O
in	O
1993	O
and	O
released	O
in	O
1995	O
.	O
</s>
<s>
The	O
PHP	B-Application
reference	O
implementation	O
is	O
now	O
produced	O
by	O
The	B-Application
PHP	I-Application
Group	I-Application
.	O
</s>
<s>
PHP	B-Application
was	O
originally	O
an	O
abbreviation	O
of	O
Personal	B-Application
Home	I-Application
Page	I-Application
,	O
but	O
it	O
now	O
stands	O
for	O
the	O
recursive	O
initialism	O
PHP	B-Application
:	I-Application
Hypertext	I-Application
Preprocessor	I-Application
.	O
</s>
<s>
PHP	B-Application
code	O
is	O
usually	O
processed	O
on	O
a	O
web	B-Application
server	I-Application
by	O
a	O
PHP	B-Application
interpreter	I-Application
implemented	O
as	O
a	O
module	B-Application
,	O
a	O
daemon	B-Operating_System
or	O
as	O
a	O
Common	B-Language
Gateway	I-Language
Interface	I-Language
(	O
CGI	O
)	O
executable	O
.	O
</s>
<s>
On	O
a	O
web	B-Application
server	I-Application
,	O
the	O
result	O
of	O
the	O
interpreted	B-Application
and	O
executed	B-General_Concept
PHP	B-Application
code	O
which	O
may	O
be	O
any	O
type	O
of	O
data	O
,	O
such	O
as	O
generated	O
HTML	B-Language
or	O
binary	O
image	O
data	O
would	O
form	O
the	O
whole	O
or	O
part	O
of	O
an	O
HTTP	B-Protocol
response	O
.	O
</s>
<s>
Various	O
web	B-Application
template	I-Application
systems	I-Application
,	O
web	O
content	B-Protocol
management	I-Protocol
systems	I-Protocol
,	O
and	O
web	B-Application
frameworks	I-Application
exist	O
which	O
can	O
be	O
employed	O
to	O
orchestrate	O
or	O
facilitate	O
the	O
generation	O
of	O
that	O
response	O
.	O
</s>
<s>
Additionally	O
,	O
PHP	B-Application
can	O
be	O
used	O
for	O
many	O
programming	O
tasks	O
outside	O
the	O
web	O
context	O
,	O
such	O
as	O
standalone	O
graphical	B-Application
applications	I-Application
and	O
robotic	O
drone	O
control	O
.	O
</s>
<s>
PHP	B-Application
code	O
can	O
also	O
be	O
directly	O
executed	B-General_Concept
from	O
the	O
command	B-Application
line	I-Application
.	O
</s>
<s>
The	O
standard	O
PHP	B-Application
interpreter	I-Application
,	O
powered	O
by	O
the	O
Zend	B-Language
Engine	I-Language
,	O
is	O
free	B-Application
software	I-Application
released	O
under	O
the	O
PHP	B-Language
License	I-Language
.	O
</s>
<s>
PHP	B-Application
has	O
been	O
widely	O
ported	O
and	O
can	O
be	O
deployed	O
on	O
most	O
web	B-Application
servers	I-Application
on	O
a	O
variety	O
of	O
operating	B-General_Concept
systems	I-General_Concept
and	O
platforms	B-Device
.	O
</s>
<s>
The	O
PHP	B-Application
language	I-Application
evolved	O
without	O
a	O
written	O
formal	B-Application
specification	I-Application
or	O
standard	O
until	O
2014	O
,	O
with	O
the	O
original	O
implementation	O
acting	O
as	O
the	O
de	O
facto	O
standard	O
which	O
other	O
implementations	O
aimed	O
to	O
follow	O
.	O
</s>
<s>
Since	O
2014	O
,	O
work	O
has	O
gone	O
on	O
to	O
create	O
a	O
formal	O
PHP	B-Application
specification	B-Application
.	O
</s>
<s>
W3Techs	O
reports	O
that	O
,	O
"	O
PHP	B-Application
is	O
used	O
by	O
77.8	O
%	O
of	O
all	O
the	O
websites	O
whose	O
server-side	B-Language
programming	I-Language
language	O
we	O
know.	O
"	O
</s>
<s>
It	O
also	O
reports	O
that	O
only	O
8%	O
of	O
PHP	B-Application
users	O
use	O
the	O
currently	O
supported	O
8.x	O
versions	O
.	O
</s>
<s>
Most	O
use	O
unsupported	O
PHP	B-Application
7	O
,	O
more	O
specifically	O
7.4	O
,	O
and	O
even	O
PHP	B-Application
5	O
has	O
23%	O
of	O
the	O
use	O
,	O
also	O
not	O
supported	O
with	O
security	O
updates	O
,	O
and	O
known	O
to	O
have	O
serious	O
security	O
vulnerabilities	O
.	O
</s>
<s>
PHP	B-Application
development	O
began	O
in	O
1993	O
when	O
Rasmus	O
Lerdorf	O
wrote	O
several	O
Common	B-Language
Gateway	I-Language
Interface	I-Language
(	O
CGI	O
)	O
programs	O
in	O
C	B-Language
,	O
which	O
he	O
used	O
to	O
maintain	O
his	O
personal	O
homepage	O
.	O
</s>
<s>
He	O
extended	O
them	O
to	O
work	O
with	O
web	B-Application
forms	I-Application
and	O
to	O
communicate	O
with	O
databases	O
,	O
and	O
called	O
this	O
implementation	O
"	O
Personal	O
Home	O
Page/Forms	O
Interpreter	B-Application
"	O
or	O
PHP/FI	O
.	O
</s>
<s>
PHP/FI	O
could	O
be	O
used	O
to	O
build	O
simple	O
,	O
dynamic	O
web	O
applications	O
.	O
</s>
<s>
To	O
accelerate	O
bug	B-Error_Name
reporting	O
and	O
improve	O
the	O
code	O
,	O
Lerdorf	O
initially	O
announced	O
the	O
release	O
of	O
PHP/FI	O
as	O
"	O
Personal	B-Application
Home	I-Application
Page	I-Application
Tools	I-Application
(	O
PHP	B-Application
Tools	I-Application
)	O
version	O
1.0	O
"	O
on	O
the	O
Usenet	B-Application
discussion	O
group	O
comp.infosystems.www.authoring.cgi	O
on	O
June	O
8	O
,	O
1995	O
.	O
</s>
<s>
This	O
release	O
already	O
had	O
the	O
basic	O
functionality	O
that	O
PHP	B-Application
has	O
today	O
.	O
</s>
<s>
This	O
included	O
Perl-like	O
variables	O
,	O
form	O
handling	O
,	O
and	O
the	O
ability	O
to	O
embed	O
HTML	B-Language
.	O
</s>
<s>
The	O
syntax	B-Application
resembled	O
that	O
of	O
Perl	B-Language
,	O
but	O
was	O
simpler	O
,	O
more	O
limited	O
and	O
less	O
consistent	O
.	O
</s>
<s>
An	O
example	O
of	O
the	O
early	O
PHP	B-Application
syntax	B-Application
:	O
</s>
<s>
Early	O
PHP	B-Application
was	O
not	O
intended	O
to	O
be	O
a	O
new	O
programming	O
language	O
,	O
and	O
grew	O
organically	O
,	O
with	O
Lerdorf	O
noting	O
in	O
retrospect	O
:	O
"	O
I	O
do	O
n't	O
know	O
how	O
to	O
stop	O
it	O
,	O
there	O
was	O
never	O
any	O
intent	O
to	O
write	O
a	O
programming	O
language	O
 [ ... ] 	O
I	O
have	O
absolutely	O
no	O
idea	O
how	O
to	O
write	O
a	O
programming	O
language	O
,	O
I	O
just	O
kept	O
adding	O
the	O
next	O
logical	O
step	O
on	O
the	O
way.	O
"	O
</s>
<s>
A	O
development	O
team	O
began	O
to	O
form	O
and	O
,	O
after	O
months	O
of	O
work	O
and	O
beta	O
testing	O
,	O
officially	O
released	O
PHP/FI	O
2	O
in	O
November	O
1997	O
.	O
</s>
<s>
The	O
fact	O
that	O
PHP	B-Application
was	O
not	O
originally	O
designed	O
,	O
but	O
instead	O
was	O
developed	O
organically	O
has	O
led	O
to	O
inconsistent	O
naming	O
of	O
functions	O
and	O
inconsistent	O
ordering	O
of	O
their	O
parameters	O
.	O
</s>
<s>
In	O
some	O
cases	O
,	O
the	O
function	O
names	O
were	O
chosen	O
to	O
match	O
the	O
lower-level	O
libraries	B-Library
which	O
PHP	B-Application
was	O
"	O
wrapping	O
"	O
,	O
while	O
in	O
some	O
very	O
early	O
versions	O
of	O
PHP	B-Application
the	O
length	O
of	O
the	O
function	O
names	O
was	O
used	O
internally	O
as	O
a	O
hash	B-Error_Name
function	I-Error_Name
,	O
so	O
names	O
were	O
chosen	O
to	O
improve	O
the	O
distribution	O
of	O
hash	B-Error_Name
values	I-Error_Name
.	O
</s>
<s>
Zeev	O
Suraski	O
and	O
Andi	O
Gutmans	O
rewrote	O
the	O
parser	B-Language
in	O
1997	O
and	O
formed	O
the	O
base	O
of	O
PHP3	O
,	O
changing	O
the	O
language	O
's	O
name	O
to	O
the	O
recursive	O
acronym	O
PHP	B-Application
:	I-Application
Hypertext	I-Application
Preprocessor	I-Application
.	O
</s>
<s>
Suraski	O
and	O
Gutmans	O
then	O
started	O
a	O
new	O
rewrite	O
of	O
PHP	B-Application
's	O
core	O
,	O
producing	O
the	O
Zend	B-Language
Engine	I-Language
in	O
1999	O
.	O
</s>
<s>
On	O
22	O
May	O
2000	O
,	O
PHP	B-Application
4	O
,	O
powered	O
by	O
the	O
Zend	B-Language
Engine	I-Language
1.0	O
,	O
was	O
released	O
.	O
</s>
<s>
By	O
August	O
2008	O
,	O
this	O
branch	B-General_Concept
had	O
reached	O
version	O
4.4.9	O
.	O
</s>
<s>
On	O
1	O
July	O
2004	O
,	O
PHP	B-Application
5	O
was	O
released	O
,	O
powered	O
by	O
the	O
new	O
Zend	B-Language
Engine	I-Language
II	O
.	O
</s>
<s>
PHP5	O
included	O
new	O
features	O
such	O
as	O
improved	O
support	O
for	O
object-oriented	B-Language
programming	I-Language
,	O
the	O
PHP	B-Application
Data	O
Objects	O
(	O
PDO	O
)	O
extension	O
(	O
which	O
defines	O
a	O
lightweight	O
and	O
consistent	O
interface	O
for	O
accessing	O
databases	O
)	O
,	O
and	O
numerous	O
performance	O
enhancements	O
.	O
</s>
<s>
Late	O
static	O
binding	O
had	O
been	O
missing	O
from	O
previous	O
versions	O
of	O
PHP	B-Application
,	O
and	O
was	O
added	O
in	O
version	O
5.3	O
.	O
</s>
<s>
Many	O
high-profile	O
open-source	O
projects	O
ceased	O
to	O
support	O
PHP4	O
in	O
new	O
code	O
from	O
February	O
5	O
,	O
2008	O
,	O
because	O
of	O
the	O
GoPHP5	O
initiative	O
,	O
provided	O
by	O
a	O
consortium	O
of	O
PHP	B-Application
developers	B-Application
promoting	O
the	O
transition	O
from	O
PHP4	O
to	O
PHP5	O
.	O
</s>
<s>
Over	O
time	O
,	O
PHP	B-Application
interpreters	I-Application
became	O
available	O
on	O
most	O
existing	O
32-bit	O
and	O
64-bit	B-Device
operating	B-General_Concept
systems	I-General_Concept
,	O
either	O
by	O
building	O
them	O
from	O
the	O
PHP	B-Application
source	O
code	O
or	O
by	O
using	O
pre-built	O
binaries	O
.	O
</s>
<s>
For	O
PHP	B-Application
versions	O
5.3	O
and	O
5.4	O
,	O
the	O
only	O
available	O
Microsoft	B-Application
Windows	I-Application
binary	O
distributions	O
were	O
32-bit	O
IA-32	B-Device
builds	O
,	O
requiring	O
Windows	B-Application
32-bit	O
compatibility	O
mode	O
while	O
using	O
Internet	B-Application
Information	I-Application
Services	I-Application
(	O
IIS	O
)	O
on	O
a	O
64-bit	B-Device
Windows	B-Application
platform	O
.	O
</s>
<s>
PHP	B-Application
version	O
5.5	O
made	O
the	O
64-bit	O
x86-64	O
builds	O
available	O
for	O
Microsoft	B-Application
Windows	I-Application
.	O
</s>
<s>
Official	O
security	O
support	O
for	O
PHP	B-Application
5.6	O
ended	O
on	O
31	O
December	O
2018	O
.	O
</s>
<s>
PHP	B-Application
received	O
mixed	O
reviews	O
due	O
to	O
lacking	O
native	O
Unicode	O
support	O
at	O
the	O
core	O
language	O
level	O
.	O
</s>
<s>
In	O
2005	O
,	O
a	O
project	O
headed	O
by	O
Andrei	B-Language
Zmievski	I-Language
was	O
initiated	O
to	O
bring	O
native	O
Unicode	O
support	O
throughout	O
PHP	B-Application
,	O
by	O
embedding	O
the	O
International	B-Application
Components	I-Application
for	I-Application
Unicode	I-Application
(	O
ICU	O
)	O
library	O
,	O
and	O
representing	O
text	O
strings	O
as	O
UTF-16	O
internally	O
.	O
</s>
<s>
However	O
,	O
a	O
shortage	O
of	O
developers	B-Application
who	O
understood	O
the	O
necessary	O
changes	O
,	O
and	O
performance	O
problems	O
arising	O
from	O
conversion	O
to	O
and	O
from	O
UTF-16	O
,	O
which	O
is	O
rarely	O
used	O
in	O
a	O
web	O
context	O
,	O
led	O
to	O
delays	O
in	O
the	O
project	O
.	O
</s>
<s>
In	O
March	O
2010	O
,	O
the	O
project	O
in	O
its	O
current	O
form	O
was	O
officially	O
abandoned	O
,	O
and	O
a	O
PHP5.4	O
release	O
was	O
prepared	O
to	O
contain	O
most	O
remaining	O
non-Unicode	O
features	O
from	O
PHP6	O
,	O
such	O
as	O
traits	O
and	O
closure	B-Language
re-binding	O
.	O
</s>
<s>
During	O
2014	O
and	O
2015	O
,	O
a	O
new	O
major	O
PHP	B-Application
version	O
was	O
developed	O
,	O
PHP7	O
.	O
</s>
<s>
The	O
numbering	O
of	O
this	O
version	O
involved	O
some	O
debate	O
among	O
internal	O
developers	B-Application
.	O
</s>
<s>
The	O
foundation	O
of	O
PHP	B-Application
7	O
is	O
a	O
PHP	B-Application
branch	B-General_Concept
that	O
was	O
originally	O
dubbed	O
PHP	B-Application
next	O
generation	O
(	O
phpng	O
)	O
.	O
</s>
<s>
It	O
was	O
authored	O
by	O
Dmitry	O
Stogov	O
,	O
Xinchen	O
Hui	O
and	O
Nikita	O
Popov	O
,	O
and	O
aimed	O
to	O
optimize	O
PHP	B-Application
performance	O
by	O
refactoring	O
the	O
Zend	B-Language
Engine	I-Language
while	O
retaining	O
near-complete	O
language	O
compatibility	O
.	O
</s>
<s>
By	O
14	O
July	O
2014	O
,	O
WordPress-based	O
benchmarks	O
,	O
which	O
served	O
as	O
the	O
main	O
benchmark	O
suite	O
for	O
the	O
phpng	O
project	O
,	O
showed	O
an	O
almost	O
100%	O
increase	O
in	O
performance	O
.	O
</s>
<s>
Changes	O
from	O
phpng	O
make	O
it	O
easier	O
to	O
improve	O
performance	O
in	O
future	O
versions	O
,	O
as	O
more	O
compact	O
data	B-General_Concept
structures	I-General_Concept
and	O
other	O
changes	O
are	O
seen	O
as	O
better	O
suited	O
for	O
a	O
successful	O
migration	O
to	O
a	O
just-in-time	O
(	O
JIT	O
)	O
compiler	B-Language
.	O
</s>
<s>
Because	O
of	O
the	O
significant	O
changes	O
,	O
the	O
reworked	O
Zend	B-Language
Engine	I-Language
was	O
called	O
Zend	B-Language
Engine	I-Language
3	I-Language
,	O
succeeding	O
Zend	B-Language
Engine	I-Language
2	I-Language
used	O
in	O
PHP5	O
.	O
</s>
<s>
Because	O
of	O
the	O
major	O
internal	O
changes	O
in	O
phpng	O
,	O
it	O
must	O
receive	O
a	O
new	O
major	O
version	O
number	O
of	O
PHP	B-Application
,	O
rather	O
than	O
a	O
minor	O
PHP5	O
release	O
,	O
according	O
to	O
PHP	B-Application
's	O
release	O
process	O
.	O
</s>
<s>
Major	O
versions	O
of	O
PHP	B-Application
are	O
allowed	O
to	O
break	O
backward-compatibility	O
of	O
code	O
and	O
therefore	O
PHP7	O
presented	O
an	O
opportunity	O
for	O
other	O
improvements	O
beyond	O
phpng	O
that	O
require	O
backward-compatibility	O
breaks	O
.	O
</s>
<s>
Many	O
fatal	O
or	O
recoverable-level	O
legacy	O
PHP	B-Application
error	O
mechanisms	O
were	O
replaced	O
with	O
modern	O
object-oriented	B-Language
exceptions	B-General_Concept
.	O
</s>
<s>
The	O
syntax	B-Application
for	O
variable	O
dereferencing	O
was	O
reworked	O
to	O
be	O
internally	O
more	O
consistent	O
and	O
complete	O
,	O
allowing	O
the	O
use	O
of	O
the	O
operators	O
->	O
,	O
[],	O
(	O
)	O
,{},	O
and	O
::	O
,	O
with	O
arbitrary	O
meaningful	O
left-side	O
expressions	O
.	O
</s>
<s>
Constructors	O
for	O
the	O
few	O
classes	O
built-in	O
to	O
PHP	B-Application
which	O
returned	O
null	O
upon	O
failure	O
were	O
changed	O
to	O
throw	O
an	O
exception	O
instead	O
,	O
for	O
consistency	O
.	O
</s>
<s>
Several	O
unmaintained	O
or	O
deprecated	O
server	B-General_Concept
application	I-General_Concept
programming	I-General_Concept
interfaces	I-General_Concept
(	O
SAPIs	O
)	O
and	O
extensions	B-Application
were	O
removed	O
from	O
the	O
PHP	B-Application
core	O
,	O
most	O
notably	O
the	O
legacy	O
mysql	B-Application
extension	O
.	O
</s>
<s>
Support	O
was	O
removed	O
for	O
legacy	O
ASP-style	O
delimiters	B-Algorithm
<% and %> and <script language="php"> ... </script>	O
.	O
</s>
<s>
The	O
left-shift	O
and	O
right-shift	O
operators	O
were	O
changed	O
to	O
behave	O
more	O
consistently	O
across	O
platforms	B-Device
.	O
</s>
<s>
Conversions	O
between	O
floating-point	B-Algorithm
numbers	I-Algorithm
and	O
integers	O
were	O
changed	O
(	O
e.g.	O
</s>
<s>
infinity	O
changed	O
to	O
convert	O
to	O
zero	O
)	O
and	O
implemented	O
more	O
consistently	O
across	O
platforms	B-Device
.	O
</s>
<s>
PHP	B-Application
7	O
also	O
included	O
new	O
language	O
features	O
.	O
</s>
<s>
Most	O
notably	O
,	O
it	O
introduced	O
return	O
type	O
declarations	O
for	O
functions	O
which	O
complement	O
the	O
existing	O
parameter	O
type	O
declarations	O
,	O
and	O
support	O
for	O
the	O
scalar	O
types	O
(	O
integer	O
,	O
float	B-Algorithm
,	O
string	O
,	O
and	O
boolean	O
)	O
in	O
parameter	O
and	O
return	O
type	O
declarations	O
.	O
</s>
<s>
PHP	B-Application
8	O
was	O
released	O
on	O
November	O
26	O
,	O
2020	O
.	O
</s>
<s>
PHP	B-Application
8	O
is	O
a	O
major	O
version	O
and	O
has	O
breaking	O
changes	O
from	O
previous	O
versions	O
.	O
</s>
<s>
Just-in-time	O
compilation	B-Language
is	O
supported	O
in	O
PHP	B-Application
8	O
.	O
</s>
<s>
PHP	B-Application
8	O
's	O
JIT	O
compiler	B-Language
can	O
provide	O
substantial	O
performance	O
improvements	O
for	O
some	O
use	O
cases	O
,	O
while	O
PHP	B-Application
developer	B-Application
Nikita	O
Popov	O
stated	O
that	O
the	O
performance	O
improvements	O
for	O
most	O
websites	O
will	O
be	O
less	O
substantial	O
than	O
the	O
upgrade	O
from	O
PHP	B-Application
5	O
to	O
PHP	B-Application
7	O
.	O
</s>
<s>
Additionally	O
,	O
the	O
JIT	O
compiler	B-Language
provides	O
the	O
future	O
potential	O
to	O
move	O
some	O
code	O
from	O
C	B-Language
to	O
PHP	B-Application
,	O
due	O
to	O
the	O
performance	O
improvements	O
for	O
some	O
use	O
cases	O
.	O
</s>
<s>
PHP	B-Application
8	O
introduced	O
the	O
expression	O
.	O
</s>
<s>
PHP	B-Application
8	O
introduced	O
union	O
types	O
,	O
a	O
new	O
return	O
type	O
,	O
and	O
a	O
new	O
type	O
.	O
</s>
<s>
"	O
Attributes	O
"	O
,	O
often	O
referred	O
to	O
as	O
"	O
annotations	O
"	O
in	O
other	O
programming	O
languages	O
,	O
were	O
added	O
in	O
PHP	B-Application
8	O
,	O
which	O
allow	O
metadata	O
to	O
be	O
added	O
to	O
classes	O
.	O
</s>
<s>
This	O
allows	O
exceptions	B-General_Concept
to	O
be	O
thrown	O
in	O
places	O
that	O
were	O
not	O
previously	O
possible	O
.	O
</s>
<s>
PHP	B-Application
8	O
includes	O
changes	O
to	O
allow	O
alternate	O
,	O
more	O
concise	O
,	O
or	O
more	O
consistent	O
syntaxes	B-Application
in	O
a	O
number	O
of	O
scenarios	O
.	O
</s>
<s>
Other	O
minor	O
changes	O
include	O
support	O
for	O
use	O
of	O
on	O
objects	O
,	O
which	O
serves	O
as	O
an	O
alternative	O
for	O
the	O
use	O
of	O
;	O
non-capturing	O
catches	O
in	O
try-catch	B-General_Concept
blocks	I-General_Concept
;	O
variable	O
syntax	B-Application
tweaks	O
to	O
resolve	O
inconsistencies	O
;	O
support	O
for	O
named	O
arguments	O
;	O
and	O
support	O
for	O
trailing	O
commas	O
in	O
parameter	O
lists	O
,	O
which	O
adds	O
consistency	O
with	O
support	O
for	O
trailing	O
commas	O
in	O
other	O
contexts	O
,	O
such	O
as	O
in	O
arrays	O
.	O
</s>
<s>
Weak	O
maps	O
were	O
added	O
in	O
PHP	B-Application
8	O
.	O
</s>
<s>
A	O
holds	O
references	O
to	O
objects	O
,	O
but	O
these	O
references	O
do	O
not	O
prevent	O
such	O
objects	O
from	O
being	O
garbage	B-General_Concept
collected	I-General_Concept
.	O
</s>
<s>
This	O
can	O
provide	O
performance	O
improvements	O
in	O
scenarios	O
where	O
data	O
is	O
being	O
cached	B-General_Concept
;	O
this	O
is	O
of	O
particular	O
relevance	O
for	O
object	B-General_Concept
relational	I-General_Concept
mappings	I-General_Concept
(	O
ORM	O
)	O
.	O
</s>
<s>
Various	O
adjustments	O
to	O
interfaces	B-Application
,	O
such	O
as	O
adding	O
support	O
for	O
creating	O
objects	O
from	O
interfaces	B-Application
,	O
and	O
the	O
addition	O
of	O
a	O
interface	O
that	O
can	O
be	O
used	O
for	O
type	O
hinting	O
.	O
</s>
<s>
Type	O
annotations	O
were	O
also	O
added	O
into	O
PHP	B-Application
's	O
C	B-Language
source	O
code	O
itself	O
to	O
allow	O
internal	O
functions	O
and	O
methods	O
to	O
have	O
"	O
complete	O
type	O
information	O
in	O
reflection.	O
"	O
</s>
<s>
PHP	B-Application
8.1	O
was	O
released	O
on	O
December	O
8	O
,	O
2021	O
,	O
and	O
included	O
a	O
number	O
of	O
new	O
features	O
and	O
improvements	O
over	O
previous	O
versions	O
.	O
</s>
<s>
Here	O
is	O
a	O
more	O
detailed	O
look	O
at	O
some	O
of	O
the	O
key	O
features	O
and	O
improvements	O
in	O
PHP	B-Application
8.1	O
:	O
</s>
<s>
Nullsafe	O
operator	O
:	O
This	O
operator	O
allows	O
you	O
to	O
chain	O
method	B-Language
calls	I-Language
without	O
worrying	O
about	O
null	O
references	O
.	O
</s>
<s>
Improved	O
performance	O
:	O
PHP	B-Application
8.1	O
includes	O
various	O
performance	O
improvements	O
,	O
such	O
as	O
faster	O
array	O
operations	O
and	O
better	O
memory	O
usage	O
.	O
</s>
<s>
New	O
error	B-General_Concept
handling	I-General_Concept
features	O
:	O
PHP	B-Application
8.1	O
introduces	O
a	O
new	O
throws	O
keyword	O
that	O
allows	O
you	O
to	O
specify	O
which	O
exceptions	B-General_Concept
a	O
function	O
can	O
throw	O
,	O
and	O
a	O
new	O
assert( )	O
function	O
that	O
can	O
be	O
used	O
to	O
check	O
for	O
certain	O
conditions	O
at	O
runtime	O
.	O
</s>
<s>
Other	O
new	O
features	O
:	O
PHP	B-Application
8.1	O
also	O
includes	O
other	O
new	O
features	O
such	O
as	O
support	O
for	O
named	O
arguments	O
,	O
support	O
for	O
attributes	O
(	O
similar	O
to	O
annotations	O
in	O
other	O
languages	O
)	O
,	O
and	O
improved	O
support	O
for	O
Unicode	O
.	O
</s>
<s>
The	O
match	O
expression	O
is	O
a	O
new	O
feature	O
in	O
PHP	B-Application
8.1	O
that	O
allows	O
you	O
to	O
perform	O
value	O
matching	O
in	O
a	O
more	O
concise	O
and	O
flexible	O
way	O
.	O
</s>
<s>
It	O
is	O
similar	O
to	O
a	O
switch	O
statement	O
,	O
but	O
with	O
some	O
additional	O
features	O
and	O
syntax	B-Application
improvements	O
.	O
</s>
<s>
Here	O
is	O
an	O
example	O
of	O
how	O
you	O
can	O
use	O
the	O
match	O
expression	O
in	O
PHP:In	O
this	O
example	O
,	O
the	O
match	O
expression	O
compares	O
the	O
value	O
of	O
$value	O
to	O
the	O
different	O
cases	O
specified	O
in	O
the	O
curly	O
braces	O
.	O
</s>
<s>
The	O
assert( )	O
function	O
and	O
the	O
throws	O
keyword	O
are	O
new	O
error-handling	O
features	O
in	O
PHP	B-Application
8.1	O
that	O
can	O
help	O
you	O
write	O
more	O
reliable	O
and	O
robust	O
code	O
.	O
</s>
<s>
The	O
throws	O
keyword	O
,	O
on	O
the	O
other	O
hand	O
,	O
is	O
used	O
to	O
specify	O
which	O
exceptions	B-General_Concept
a	O
function	O
or	O
method	O
can	O
throw	O
.	O
</s>
<s>
This	O
can	O
be	O
helpful	O
for	O
documenting	O
your	O
code	O
and	O
making	O
it	O
easier	O
for	O
other	O
developers	B-Application
to	O
understand	O
how	O
your	O
functions	O
and	O
methods	O
behave	O
.	O
</s>
<s>
Overall	O
,	O
the	O
assert( )	O
function	O
and	O
the	O
throws	O
keyword	O
are	O
useful	O
tools	O
for	O
handling	O
errors	O
and	O
exceptions	B-General_Concept
in	O
PHP	B-Application
and	O
can	O
help	O
you	O
write	O
more	O
reliable	O
and	O
robust	O
code	O
.	O
</s>
<s>
Support	O
for	O
enumerations	O
was	O
one	O
of	O
the	O
most	O
prominent	O
features	O
of	O
PHP	B-Application
8.1	O
.	O
</s>
<s>
Enums	O
allow	O
developers	B-Application
to	O
programmatically	O
enforce	O
states	O
in	O
their	O
codebase	O
.	O
</s>
<s>
After	O
the	O
introduction	O
of	O
array	O
unpacking	O
in	O
PHP	B-Application
7.4	O
with	O
consecutively	O
numbered	O
keys	O
,	O
PHP	B-Application
8.1	O
introduced	O
support	O
for	O
array	O
unpacking	O
with	O
string	O
keys	O
.	O
</s>
<s>
PHP	B-Application
8.1	O
added	O
support	O
for	O
using	O
`new`	O
in	O
initializers	O
.	O
</s>
<s>
A	O
new	O
syntax	B-Application
was	O
added	O
for	O
creating	O
callables	O
.	O
</s>
<s>
PHP	B-Application
8.1	O
brought	O
support	O
for	O
Pure	O
Intersection	O
Types	O
,	O
after	O
the	O
introduction	O
of	O
union	O
types	O
in	O
PHP	B-Application
8.0	O
.	O
</s>
<s>
PHP	B-Application
8.2	O
includes	O
a	O
number	O
of	O
new	O
features	O
and	O
improvements	O
.	O
</s>
<s>
Nullsafe	O
Operator	O
:	O
The	O
nullsafe	O
operator	O
(?->	O
)	O
allows	O
you	O
to	O
chain	O
method	B-Language
calls	I-Language
without	O
having	O
to	O
check	O
for	O
null	O
values	O
at	O
each	O
step	O
.	O
</s>
<s>
Improved	O
Type	O
Variance	O
:	O
PHP	B-Application
8.2	O
introduces	O
improved	O
type	O
variance	O
for	O
generic	O
types	O
,	O
allowing	O
you	O
to	O
specify	O
whether	O
a	O
generic	O
type	O
is	O
covariant	O
,	O
contravariant	O
,	O
or	O
invariant	O
.	O
</s>
<s>
Performance	O
Improvements	O
:	O
PHP	B-Application
8.2	O
includes	O
various	O
performance	O
improvements	O
,	O
including	O
faster	O
JIT	O
compilation	B-Language
,	O
faster	O
garbage	B-General_Concept
collection	I-General_Concept
,	O
and	O
improved	O
handling	O
of	O
large	O
arrays	O
.	O
</s>
<s>
These	O
improvements	O
can	O
help	O
to	O
make	O
PHP	B-Application
applications	O
faster	O
and	O
more	O
efficient	O
.	O
</s>
<s>
Deprecations	O
:	O
Some	O
features	O
have	O
been	O
deprecated	O
in	O
PHP	B-Application
8.2	O
,	O
including	O
the	O
assert( )	O
function	O
when	O
used	O
with	O
a	O
string	O
argument	O
,	O
and	O
the	O
list( )	O
construct	O
with	O
a	O
single	O
array	O
element	O
.	O
</s>
<s>
It	O
's	O
important	O
to	O
be	O
aware	O
of	O
these	O
deprecations	O
if	O
you	O
are	O
upgrading	O
from	O
an	O
earlier	O
version	O
of	O
PHP	B-Application
.	O
</s>
<s>
Here	O
are	O
some	O
examples	O
of	O
features	O
that	O
have	O
been	O
deprecated	O
in	O
PHP	B-Application
8.2	O
:	O
</s>
<s>
create_function( )	O
:	O
The	O
create_function( )	O
function	O
has	O
been	O
deprecated	O
,	O
as	O
it	O
has	O
been	O
superseded	O
by	O
anonymous	B-General_Concept
functions	I-General_Concept
,	O
which	O
are	O
more	O
flexible	O
and	O
easier	O
to	O
use	O
.	O
</s>
<s>
Callables	O
that	O
are	O
not	O
accepted	O
by	O
the	O
$	O
callable( )	O
syntax	B-Application
(	O
but	O
are	O
accepted	O
by	O
call_user_func( )	O
)	O
are	O
deprecated	O
.	O
</s>
<s>
The	O
"	O
Random	O
"	O
extension	O
provides	O
a	O
new	O
object-oriented	B-Language
API	O
for	O
generating	O
random	O
values	O
in	O
PHP	B-Application
.	O
</s>
<s>
It	O
's	O
worth	O
noting	O
that	O
the	O
"	O
Random	O
"	O
extension	O
is	O
not	O
enabled	O
by	O
default	O
in	O
PHP	B-Application
,	O
and	O
you	O
will	O
need	O
to	O
install	O
and	O
enable	O
it	O
in	O
your	O
PHP	B-Application
environment	O
in	O
order	O
to	O
use	O
its	O
features	O
.	O
</s>
<s>
You	O
can	O
find	O
more	O
information	O
about	O
the	O
extension	O
in	O
the	O
official	O
PHP	B-Application
documentation	O
.	O
</s>
<s>
Version	O
Release	O
date	O
Supported	O
until	O
Notes	O
8	O
June	O
1995	O
Officially	O
called	O
"	O
Personal	B-Application
Home	I-Application
Page	I-Application
Tools	I-Application
(	O
PHP	B-Application
Tools	I-Application
)	O
"	O
.	O
</s>
<s>
This	O
is	O
the	O
first	O
use	O
of	O
the	O
name	O
"	O
PHP	B-Application
"	O
.	O
</s>
<s>
1	O
November	O
1997	O
Officially	O
called	O
"	O
PHP/FI	O
2.0	O
"	O
.	O
</s>
<s>
This	O
is	O
the	O
first	O
release	O
that	O
could	O
actually	O
be	O
characterised	O
as	O
PHP	B-Application
,	O
being	O
a	O
standalone	O
language	O
with	O
many	O
features	O
that	O
have	O
endured	O
to	O
the	O
present	O
day	O
.	O
</s>
<s>
6	O
June	O
1998	O
20	O
October	O
2000	O
Development	O
moves	O
from	O
one	O
person	O
to	O
multiple	O
developers	B-Application
.	O
</s>
<s>
22	O
May	O
2000	O
23	O
June	O
2001	O
Added	O
more	O
advanced	O
two-stage	O
parse/execute	O
tag-parsing	O
system	O
called	O
the	O
Zend	B-Language
engine	I-Language
.	O
</s>
<s>
27	O
December	O
2002	O
31	O
March	O
2005	O
Introduced	O
the	O
command-line	B-Application
interface	I-Application
(	O
CLI	O
)	O
,	O
to	O
supplement	O
the	O
CGI	O
.	O
</s>
<s>
11	O
July	O
2005	O
7	O
August	O
2008	O
Fixed	O
a	O
memory	O
corruption	O
bug	B-Error_Name
,	O
which	O
required	O
breaking	O
binary	O
compatibility	O
with	O
extensions	B-Application
compiled	B-Language
against	O
PHP	B-Application
version	O
4.3.x	O
.	O
</s>
<s>
13	O
July	O
2004	O
5	O
September	O
2005	O
Zend	B-Language
Engine	I-Language
II	O
with	O
a	O
new	O
object	O
model	O
.	O
</s>
<s>
24	O
November	O
2005	O
24	O
August	O
2006	O
Performance	O
improvements	O
with	O
the	O
introduction	O
of	O
compiler	B-Language
variables	O
in	O
re-engineered	O
PHP	B-Application
Engine	O
.	O
</s>
<s>
Added	O
PHP	B-Application
Data	O
Objects	O
(	O
PDO	O
)	O
as	O
a	O
consistent	O
interface	O
for	O
accessing	O
databases	O
.	O
</s>
<s>
Native	O
JSON	B-General_Concept
support	O
.	O
</s>
<s>
30	O
June	O
2009	O
14	O
August	O
2014	O
Namespace	O
support	O
;	O
late	O
static	O
bindings	O
,	O
jump	O
label	O
(	O
limited	O
goto	B-Application
)	O
,	O
anonymous	B-General_Concept
functions	I-General_Concept
,	O
closures	B-Language
,	O
PHP	B-Application
archives	O
(	O
phar	O
)	O
,	O
garbage	B-General_Concept
collection	I-General_Concept
for	O
circular	O
references	O
,	O
improved	O
Windows	B-Application
support	O
,	O
sqlite3	B-Language
,	O
mysqlnd	O
as	O
a	O
replacement	O
for	O
libmysql	O
as	O
the	O
underlying	O
library	O
for	O
the	O
extensions	B-Application
that	O
work	O
with	O
MySQL	B-Application
,	O
fileinfo	O
as	O
a	O
replacement	O
for	O
mime_magic	O
for	O
better	O
MIME	B-Protocol
support	O
,	O
the	O
Internationalization	O
extension	O
,	O
and	O
deprecation	O
of	O
ereg	O
extension	O
.	O
</s>
<s>
1	O
March	O
2012	O
3	O
September	O
2015	O
Trait	O
support	O
,	O
short	O
array	O
syntax	B-Application
support	O
.	O
</s>
<s>
Built-in	O
web	B-Application
server	I-Application
.	O
</s>
<s>
20	O
June	O
2013	O
10	O
July	O
2016	O
Support	O
for	O
generators	O
,	O
finally	O
blocks	O
for	O
exceptions	B-General_Concept
handling	I-General_Concept
,	O
OpCache	O
(	O
based	O
on	O
Zend	O
Optimizer+	O
)	O
bundled	O
in	O
official	O
distribution	O
.	O
</s>
<s>
28	O
August	O
2014	O
31	O
December	O
2018	O
Constant	O
scalar	O
expressions	O
,	O
variadic	B-Language
functions	I-Language
,	O
argument	O
unpacking	O
,	O
new	O
exponentiation	O
operator	O
,	O
extensions	B-Application
of	O
the	O
use	O
statement	O
for	O
functions	O
and	O
constants	O
,	O
new	O
phpdbg	O
debugger	O
as	O
a	O
SAPI	O
module	B-Application
,	O
and	O
other	O
smaller	O
improvements	O
.	O
</s>
<s>
6.x	O
Abandoned	O
version	O
of	O
PHP	B-Application
that	O
planned	O
to	O
include	O
native	O
Unicode	O
support	O
.	O
</s>
<s>
3	O
December	O
2015	O
10	O
January	O
2019	O
Zend	B-Language
Engine	I-Language
3	I-Language
(	O
performance	O
improvements	O
and	O
64-bit	B-Device
integer	O
support	O
on	O
Windows	B-Application
)	O
,	O
uniform	O
variable	O
syntax	B-Application
,	O
AST-based	O
compilation	B-Language
process	O
,	O
added	O
,	O
bitwise	O
shift	O
consistency	O
across	O
platforms	B-Device
,	O
(	O
null	O
coalesce	O
)	O
operator	O
,	O
Unicode	O
code	O
point	O
escape	O
syntax	B-Application
,	O
return	O
type	O
declarations	O
,	O
scalar	O
type	O
(	O
integer	O
,	O
float	B-Algorithm
,	O
string	O
and	O
boolean	O
)	O
declarations	O
,	O
<=>	O
"	O
spaceship	O
"	O
three-way	O
comparison	O
operator	O
,	O
generator	O
delegation	O
,	O
anonymous	O
classes	O
,	O
simpler	O
and	O
more	O
consistently	O
available	O
CSPRNG	B-Algorithm
API	O
,	O
replacement	O
of	O
many	O
remaining	O
internal	O
PHP	B-Application
"	O
errors	O
"	O
with	O
the	O
more	O
modern	O
exceptions	B-General_Concept
,	O
and	O
shorthand	O
syntax	B-Application
for	O
importing	O
multiple	O
items	O
from	O
a	O
namespace	O
.	O
</s>
<s>
1	O
December	O
2016	O
1	O
December	O
2019	O
void	O
return	O
type	O
,	O
class	O
constant	O
visibility	B-Application
modifiers	I-Application
30	O
November	O
2017	O
30	O
November	O
2020	O
Object	O
parameter	O
and	O
return	O
type	O
declaration	O
,	O
Libsodium	O
extension	O
,	O
abstract	O
method	O
overriding	O
,	O
parameter	O
type	O
widening	O
6	O
December	O
2018	O
6	O
December	O
2021	O
Flexible	O
Heredoc	O
and	O
Nowdoc	O
syntax	B-Application
,	O
support	O
for	O
reference	O
assignment	O
and	O
array	O
deconstruction	O
with	O
list( )	O
,	O
PCRE2	O
support	O
,	O
hrtime( )	O
function	O
28	O
November	O
2019	O
28	O
November	O
2022	O
Typed	O
properties	O
2.0	O
,	O
preloading	O
,	O
null-coalescing	O
assignment	O
operator	O
,	O
improve	O
openssl_random_pseudo_bytes	O
,	O
Weak	O
References	O
,	O
FFI	O
foreign	B-Application
function	I-Application
interface	I-Application
,	O
always	O
available	O
hash	B-Error_Name
extension	O
,	O
password	O
hash	B-Error_Name
registry	O
,	O
multibyte	O
string	O
splitting	O
,	O
reflection	O
for	O
references	O
,	O
unbundle	O
ext/wddx	O
,	O
new	O
custom	O
object	O
serialization	O
mechanism	O
26	O
November	O
2020	O
26	O
November	O
2023	O
Just-In-Time	O
(	O
JIT	O
)	O
compilation	B-Language
,	O
arrays	O
starting	O
with	O
a	O
negative	O
index	O
,	O
stricter/saner	O
language	O
semantics	O
(	O
validation	O
for	O
abstract	O
trait	O
methods	O
)	O
,	O
saner	O
string	O
to	O
number	O
comparisons	O
,	O
saner	O
numeric	B-Algorithm
strings	O
,	O
TypeError	O
on	O
invalid	O
arithmetic/bitwise	O
operators	O
,	O
reclassification	O
of	O
various	O
engine	O
errors	O
,	O
consistent	O
type	O
errors	O
for	O
internal	O
functions	O
,	O
fatal	O
error	O
for	O
incompatible	O
method	O
signatures	O
)	O
,	O
locale-independent	O
float	B-Algorithm
to	O
string	O
conversion	O
,	O
variable	O
syntax	B-Application
tweaks	O
,	O
attributes	O
,	O
named	O
arguments	O
,	O
match	O
expression	O
,	O
constructor	O
property	O
promotion	O
,	O
union	O
types	O
,	O
mixed	O
type	O
,	O
static	O
return	O
type	O
,	O
nullsafe	O
operator	O
,	O
non-capturing	O
catches	O
,	O
throw	O
expression	O
,	O
JSON	B-General_Concept
extension	O
is	O
always	O
available	O
.	O
</s>
<s>
Beginning	O
on	O
28	O
June	O
2011	O
,	O
the	O
PHP	B-Application
Development	O
Team	O
implemented	O
a	O
timeline	O
for	O
the	O
release	O
of	O
new	O
versions	O
of	O
PHP	B-Application
.	O
</s>
<s>
Every	O
minor	O
release	O
should	O
at	O
least	O
be	O
supported	O
for	O
two	O
years	O
with	O
security	O
and	O
bug	B-Error_Name
fixes	O
,	O
followed	O
by	O
at	O
least	O
one	O
year	O
of	O
only	O
security	O
fixes	O
,	O
for	O
a	O
total	O
of	O
a	O
three-year	O
release	O
process	O
for	O
every	O
minor	O
release	O
.	O
</s>
<s>
The	O
mascot	O
of	O
the	O
PHP	B-Application
project	O
is	O
the	O
elePHPant	O
,	O
a	O
blue	O
elephant	O
with	O
the	O
PHP	B-Application
logo	O
on	O
its	O
side	O
,	O
designed	O
by	O
Vincent	O
Pontier	O
in	O
1998	O
.	O
</s>
<s>
"	O
The	O
(	O
PHP	B-Application
)	O
letters	O
were	O
forming	O
the	O
shape	O
of	O
an	O
elephant	O
if	O
viewed	O
in	O
a	O
sideways	O
angle.	O
"	O
</s>
<s>
program	O
is	O
written	O
in	O
PHP	B-Application
code	O
embedded	O
in	O
an	O
HTML	B-Language
document	O
:	O
</s>
<s>
However	O
,	O
as	O
no	O
requirement	O
exists	O
for	O
PHP	B-Application
code	O
to	O
be	O
embedded	O
in	O
HTML	B-Language
,	O
the	O
simplest	O
version	O
of	O
Hello	O
,	O
World	O
!	O
</s>
<s>
may	O
be	O
written	O
like	O
this	O
,	O
with	O
the	O
closing	O
tag	O
omitted	O
as	O
preferred	O
in	O
files	O
containing	O
pure	O
PHP	B-Application
code	O
.	O
</s>
<s>
The	O
PHP	B-Application
interpreter	I-Application
only	O
executes	O
PHP	B-Application
code	O
within	O
its	O
delimiters	B-Algorithm
.	O
</s>
<s>
Anything	O
outside	O
of	O
its	O
delimiters	B-Algorithm
is	O
not	O
processed	O
by	O
PHP	B-Application
,	O
although	O
the	O
non-PHP	O
text	O
is	O
still	O
subject	O
to	O
control	O
structures	O
described	O
in	O
PHP	B-Application
code	O
.	O
</s>
<s>
The	O
most	O
common	O
delimiters	B-Algorithm
are	O
to	O
open	O
and	O
to	O
close	O
PHP	B-Application
sections	O
.	O
</s>
<s>
This	O
short	O
delimiter	B-Algorithm
makes	O
script	O
files	O
less	O
portable	O
since	O
support	O
for	O
them	O
can	O
be	O
disabled	O
in	O
the	O
local	O
PHP	B-Application
configuration	O
and	O
it	O
is	O
therefore	O
discouraged	O
.	O
</s>
<s>
Prior	O
to	O
PHP5.4.0	O
,	O
this	O
short	O
syntax	B-Application
for	O
only	O
works	O
with	O
the	O
short_open_tag	O
configuration	O
setting	O
enabled	O
,	O
while	O
for	O
PHP5.4.0	O
and	O
later	O
it	O
is	O
always	O
available	O
.	O
</s>
<s>
The	O
purpose	O
of	O
all	O
these	O
delimiters	B-Algorithm
is	O
to	O
separate	O
PHP	B-Application
code	O
from	O
non-PHP	O
content	O
,	O
such	O
as	O
JavaScript	B-Language
code	O
or	O
HTML	B-Language
markup	O
.	O
</s>
<s>
program	O
written	O
in	O
PHP	B-Application
is	O
:	O
</s>
<s>
The	O
first	O
form	O
of	O
delimiters	B-Algorithm
,	O
and	O
,	O
in	O
XHTML	B-Language
and	O
other	O
XML	B-Protocol
documents	I-Protocol
,	O
creates	O
correctly	O
formed	O
XML	B-Protocol
processing	O
instructions	O
.	O
</s>
<s>
This	O
means	O
that	O
the	O
resulting	O
mixture	O
of	O
PHP	B-Application
code	O
and	O
other	O
markups	O
in	O
the	O
server-side	B-Language
file	O
is	O
itself	O
well-formed	O
XML	B-Protocol
.	O
</s>
<s>
PHP5	O
introduced	O
type	O
declarations	O
that	O
allow	O
functions	O
to	O
force	O
their	O
parameters	O
to	O
be	O
objects	O
of	O
a	O
specific	O
class	O
,	O
arrays	O
,	O
interfaces	B-Application
or	O
callback	O
functions	O
.	O
</s>
<s>
Below	O
is	O
an	O
example	O
of	O
how	O
PHP	B-Application
variables	I-Application
are	O
declared	O
and	O
initialized	O
.	O
</s>
<s>
PHP	B-Application
treats	O
newlines	O
as	O
whitespace	O
in	O
the	O
manner	O
of	O
a	O
free-form	B-Language
language	I-Language
,	O
and	O
statements	O
are	O
terminated	O
by	O
a	O
semicolon	O
.	O
</s>
<s>
PHP	B-Application
has	O
three	O
types	O
of	O
comment	O
syntax	B-Application
:	O
marks	O
block	O
and	O
inline	O
comments	O
;	O
or	O
are	O
used	O
for	O
one-line	O
comments	O
.	O
</s>
<s>
The	O
echo	O
statement	O
is	O
one	O
of	O
several	O
facilities	O
PHP	B-Application
provides	O
to	O
output	O
text	O
.	O
</s>
<s>
In	O
terms	O
of	O
keywords	O
and	O
language	O
syntax	B-Application
,	O
PHP	B-Application
is	O
similar	O
to	O
C-style	O
syntax	B-Application
.	O
</s>
<s>
conditions	O
,	O
and	O
loops	O
and	O
function	O
returns	O
are	O
similar	O
in	O
syntax	B-Application
to	O
languages	O
such	O
as	O
C	B-Language
,	O
C++	B-Language
,	O
C#	O
,	O
Java	B-Language
and	O
Perl	B-Language
.	O
</s>
<s>
PHP	B-Application
is	O
loosely	O
typed	O
.	O
</s>
<s>
It	O
stores	O
integers	O
in	O
a	O
platform-dependent	O
range	O
,	O
either	O
as	O
a	O
32	O
,	O
64	O
or	O
128-bit	O
signed	B-Algorithm
integer	O
equivalent	O
to	O
the	O
C-language	B-Language
long	I-Language
type	I-Language
.	O
</s>
<s>
Unsigned	O
integers	O
are	O
converted	O
to	O
signed	B-Algorithm
values	O
in	O
certain	O
situations	O
,	O
which	O
is	O
different	O
behaviour	O
to	O
many	O
other	O
programming	O
languages	O
.	O
</s>
<s>
Floating	B-Algorithm
point	I-Algorithm
numbers	I-Algorithm
are	O
also	O
stored	O
in	O
a	O
platform-specific	O
range	O
.	O
</s>
<s>
They	O
can	O
be	O
specified	O
using	O
floating	B-Algorithm
point	I-Algorithm
notation	O
,	O
or	O
two	O
forms	O
of	O
scientific	O
notation	O
.	O
</s>
<s>
PHP	B-Application
has	O
a	O
native	O
Boolean	O
type	O
that	O
is	O
similar	O
to	O
the	O
native	O
Boolean	O
types	O
in	O
Java	B-Language
and	O
C++	B-Language
.	O
</s>
<s>
Using	O
the	O
Boolean	O
type	O
conversion	O
rules	O
,	O
non-zero	O
values	O
are	O
interpreted	B-Application
as	O
true	O
and	O
zero	O
as	O
false	O
,	O
as	O
in	O
Perl	B-Language
and	O
C++	B-Language
.	O
</s>
<s>
Arrays	O
can	O
contain	O
elements	O
of	O
any	O
type	O
that	O
PHP	B-Application
can	O
handle	O
,	O
including	O
resources	O
,	O
objects	O
,	O
and	O
even	O
other	O
arrays	O
.	O
</s>
<s>
Order	O
is	O
preserved	O
in	O
lists	O
of	O
values	O
and	O
in	O
hashes	B-Algorithm
with	O
both	O
keys	O
and	O
values	O
,	O
and	O
the	O
two	O
can	O
be	O
intermingled	O
.	O
</s>
<s>
PHP	B-Application
also	O
supports	O
strings	O
,	O
which	O
can	O
be	O
used	O
with	O
single	O
quotes	O
,	O
double	O
quotes	O
,	O
nowdoc	O
or	O
heredoc	O
syntax	B-Application
.	O
</s>
<s>
The	O
Standard	O
PHP	B-Application
Library	O
(	O
SPL	O
)	O
attempts	O
to	O
solve	O
standard	O
problems	O
and	O
implements	O
efficient	O
data	O
access	O
interfaces	B-Application
and	O
classes	O
.	O
</s>
<s>
PHP	B-Application
defines	O
a	O
large	O
array	O
of	O
functions	O
in	O
the	O
core	O
language	O
and	O
many	O
are	O
also	O
available	O
in	O
various	O
extensions	B-Application
;	O
these	O
functions	O
are	O
well	O
documented	O
online	O
.	O
</s>
<s>
Custom	O
functions	O
may	O
be	O
defined	O
by	O
the	O
developer	B-Application
:	O
</s>
<s>
In	O
lieu	O
of	O
function	B-Language
pointers	I-Language
,	O
functions	O
in	O
PHP	B-Application
can	O
be	O
referenced	O
by	O
a	O
string	O
containing	O
their	O
name	O
.	O
</s>
<s>
In	O
this	O
manner	O
,	O
normal	O
PHP	B-Application
functions	O
can	O
be	O
used	O
,	O
for	O
example	O
,	O
as	O
callbacks	O
or	O
within	O
function	O
tables	O
.	O
</s>
<s>
Function	O
calls	O
must	O
use	O
parentheses	O
,	O
with	O
the	O
exception	O
of	O
zero-argument	O
class	O
constructor	O
functions	O
called	O
with	O
the	O
PHP	B-Application
operator	O
new	O
,	O
in	O
which	O
case	O
parentheses	O
are	O
optional	O
.	O
</s>
<s>
Since	O
PHP4.0.1	O
create_function( )	O
,	O
a	O
thin	O
wrapper	O
around	O
eval( )	O
,	O
allowed	O
normal	O
PHP	B-Application
functions	O
to	O
be	O
created	O
during	O
program	O
execution	O
;	O
it	O
was	O
deprecated	O
in	O
PHP7.2	O
and	O
removed	O
in	O
PHP8.0	O
in	O
favor	O
of	O
syntax	B-Application
for	O
anonymous	B-General_Concept
functions	I-General_Concept
or	O
"	O
closures	B-Language
"	O
that	O
can	O
capture	O
variables	O
from	O
the	O
surrounding	O
scope	O
,	O
which	O
was	O
added	O
in	O
PHP5.3	O
.	O
</s>
<s>
Shorthand	O
arrow	O
syntax	B-Application
was	O
added	O
in	O
PHP	B-Application
7.4	O
:	O
</s>
<s>
In	O
the	O
example	O
above	O
,	O
getAdder( )	O
function	O
creates	O
a	O
closure	B-Language
using	O
passed	O
argument	O
,	O
which	O
takes	O
an	O
additional	O
argument	O
,	O
and	O
returns	O
the	O
created	O
closure	B-Language
to	O
the	O
caller	O
.	O
</s>
<s>
Unusually	O
for	O
a	O
dynamically	O
typed	O
language	O
,	O
PHP	B-Application
supports	O
type	O
declarations	O
on	O
function	O
parameters	O
,	O
which	O
are	O
enforced	O
at	O
runtime	O
.	O
</s>
<s>
This	O
has	O
been	O
supported	O
for	O
classes	O
and	O
interfaces	B-Application
since	O
PHP5.0	O
,	O
for	O
arrays	O
since	O
PHP5.1	O
,	O
for	O
"	O
callables	O
"	O
since	O
PHP5.4	O
,	O
and	O
scalar	O
(	O
integer	O
,	O
float	B-Algorithm
,	O
string	O
and	O
boolean	O
)	O
types	O
since	O
PHP7.0	O
.	O
</s>
<s>
So	O
,	O
for	O
example	O
,	O
if	O
a	O
parameter	O
's	O
type	O
is	O
int	O
,	O
PHP	B-Application
would	O
allow	O
not	O
only	O
integers	O
,	O
but	O
also	O
convertible	O
numeric	B-Algorithm
strings	O
,	O
floats	B-Algorithm
or	O
booleans	O
to	O
be	O
passed	O
to	O
that	O
function	O
,	O
and	O
would	O
convert	O
them	O
.	O
</s>
<s>
Basic	O
object-oriented	B-Language
programming	I-Language
functionality	O
was	O
added	O
in	O
PHP3	O
and	O
improved	O
in	O
PHP4	O
.	O
</s>
<s>
This	O
allowed	O
for	O
PHP	B-Application
to	O
gain	O
further	O
abstraction	O
,	O
making	O
creative	O
tasks	O
easier	O
for	O
programmers	B-Application
using	O
the	O
language	O
.	O
</s>
<s>
In	O
previous	O
versions	O
of	O
PHP	B-Application
,	O
objects	O
were	O
handled	O
like	O
value	O
types	O
.	O
</s>
<s>
The	O
drawback	O
of	O
this	O
method	O
was	O
that	O
code	O
had	O
to	O
make	O
heavy	O
use	O
of	O
PHP	B-Application
's	O
"	O
reference	O
"	O
variables	O
if	O
it	O
wanted	O
to	O
modify	O
an	O
object	O
it	O
was	O
passed	O
rather	O
than	O
creating	O
a	O
copy	O
of	O
it	O
.	O
</s>
<s>
PHP	B-Application
5	O
introduced	O
private	O
and	O
protected	O
member	B-Application
variables	I-Application
and	O
methods	O
,	O
along	O
with	O
abstract	O
classes	O
,	O
final	O
classes	O
,	O
abstract	O
methods	O
,	O
and	O
final	B-Language
methods	I-Language
.	O
</s>
<s>
It	O
also	O
introduced	O
a	O
standard	O
way	O
of	O
declaring	O
constructors	O
and	O
destructors	B-Language
,	O
similar	O
to	O
that	O
of	O
other	O
object-oriented	B-Language
languages	I-Language
such	O
as	O
C++	B-Language
,	O
and	O
a	O
standard	O
exception	B-General_Concept
handling	I-General_Concept
model	O
.	O
</s>
<s>
Furthermore	O
,	O
PHP5	O
added	O
interfaces	B-Application
and	O
allowed	O
for	O
multiple	O
interfaces	B-Application
to	O
be	O
implemented	O
.	O
</s>
<s>
There	O
are	O
special	O
interfaces	B-Application
that	O
allow	O
objects	O
to	O
interact	O
with	O
the	O
runtime	O
system	O
.	O
</s>
<s>
Objects	O
implementing	O
ArrayAccess	O
can	O
be	O
used	O
with	O
array	O
syntax	B-Application
and	O
objects	O
implementing	O
Iterator	O
or	O
IteratorAggregate	O
can	O
be	O
used	O
with	O
the	O
foreach	O
language	B-Language
construct	I-Language
.	O
</s>
<s>
There	O
is	O
no	O
virtual	B-Language
table	I-Language
feature	O
in	O
the	O
engine	O
,	O
so	O
static	B-General_Concept
variables	I-General_Concept
are	O
bound	O
with	O
a	O
name	O
instead	O
of	O
a	O
reference	O
at	O
compile	B-Language
time	O
.	O
</s>
<s>
If	O
the	O
developer	B-Application
creates	O
a	O
copy	O
of	O
an	O
object	O
using	O
the	O
reserved	O
word	O
clone	O
,	O
the	O
Zend	B-Language
engine	I-Language
will	O
check	O
whether	O
a	O
__clone( )	O
method	O
has	O
been	O
defined	O
.	O
</s>
<s>
For	O
convenience	O
,	O
the	O
engine	O
will	O
supply	O
a	O
function	O
that	O
imports	O
the	O
properties	O
of	O
the	O
source	O
object	O
,	O
so	O
the	O
programmer	B-Application
can	O
start	O
with	O
a	O
by-value	O
replica	O
of	O
the	O
source	O
object	O
and	O
only	O
override	O
properties	O
that	O
need	O
to	O
be	O
changed	O
.	O
</s>
<s>
The	O
visibility	B-Application
of	O
PHP	B-Application
properties	O
and	O
methods	O
is	O
defined	O
using	O
the	O
keywords	O
public	O
,	O
private	O
,	O
and	O
protected	O
.	O
</s>
<s>
private	O
limits	O
visibility	B-Application
only	O
to	O
the	O
class	O
that	O
defines	O
the	O
item	O
.	O
</s>
<s>
The	O
following	O
is	O
a	O
basic	O
example	O
of	O
object-oriented	B-Language
programming	I-Language
in	O
PHP	B-Application
8	O
:	O
</s>
<s>
The	O
only	O
complete	O
PHP	B-Application
implementation	O
is	O
the	O
original	O
,	O
known	O
simply	O
as	O
PHP	B-Application
.	O
</s>
<s>
It	O
is	O
the	O
most	O
widely	O
used	O
and	O
is	O
powered	O
by	O
the	O
Zend	B-Language
Engine	I-Language
.	O
</s>
<s>
To	O
disambiguate	O
it	O
from	O
other	O
implementations	O
,	O
it	O
is	O
sometimes	O
unofficially	O
called	O
"	O
Zend	O
PHP	B-Application
"	O
.	O
</s>
<s>
The	O
Zend	B-Language
Engine	I-Language
compiles	B-Language
PHP	B-Application
source	O
code	O
on-the-fly	O
into	O
an	O
internal	O
format	O
that	O
it	O
can	O
execute	O
,	O
thus	O
it	O
works	O
as	O
an	O
interpreter	B-Application
.	O
</s>
<s>
It	O
is	O
also	O
the	O
"	O
reference	O
implementation	O
"	O
of	O
PHP	B-Application
,	O
as	O
PHP	B-Application
has	O
no	O
formal	B-Application
specification	I-Application
,	O
and	O
so	O
the	O
semantics	O
of	O
Zend	O
PHP	B-Application
define	O
the	O
semantics	O
of	O
PHP	B-Application
.	O
</s>
<s>
Due	O
to	O
the	O
complex	O
and	O
nuanced	O
semantics	O
of	O
PHP	B-Application
,	O
defined	O
by	O
how	O
Zend	O
works	O
,	O
it	O
is	O
difficult	O
for	O
competing	O
implementations	O
to	O
offer	O
complete	O
compatibility	O
.	O
</s>
<s>
PHP	B-Application
's	O
single-request-per-script-execution	O
model	O
,	O
and	O
the	O
fact	O
that	O
the	O
Zend	B-Language
Engine	I-Language
is	O
an	O
interpreter	B-Application
,	O
leads	O
to	O
inefficiency	O
;	O
as	O
a	O
result	O
,	O
various	O
products	O
have	O
been	O
developed	O
to	O
help	O
improve	O
PHP	B-Application
performance	O
.	O
</s>
<s>
In	O
order	O
to	O
speed	O
up	O
execution	O
time	O
and	O
not	O
have	O
to	O
compile	B-Language
the	O
PHP	B-Application
source	O
code	O
every	O
time	O
the	O
web	O
page	O
is	O
accessed	O
,	O
PHP	B-Application
scripts	I-Application
can	O
also	O
be	O
deployed	O
in	O
the	O
PHP	B-Application
engine	O
's	O
internal	O
format	O
by	O
using	O
an	O
opcode	B-Language
cache	B-General_Concept
,	O
which	O
works	O
by	O
caching	B-General_Concept
the	O
compiled	B-Language
form	O
of	O
a	O
PHP	B-Application
script	I-Application
(	O
opcodes	B-Language
)	O
in	O
shared	B-Operating_System
memory	I-Operating_System
to	O
avoid	O
the	O
overhead	O
of	O
parsing	B-Language
and	O
compiling	B-Language
the	O
code	O
every	O
time	O
the	O
script	O
runs	O
.	O
</s>
<s>
An	O
opcode	B-Language
cache	B-General_Concept
,	O
Zend	O
Opcache	O
,	O
is	O
built	O
into	O
PHP	B-Application
since	O
version	O
5.5	O
.	O
</s>
<s>
Another	O
example	O
of	O
a	O
widely	O
used	O
opcode	B-Language
cache	B-General_Concept
is	O
the	O
Alternative	O
PHP	B-Application
Cache	B-General_Concept
(	O
APC	O
)	O
,	O
which	O
is	O
available	O
as	O
a	O
PECL	O
extension	O
.	O
</s>
<s>
While	O
Zend	O
PHP	B-Application
is	O
still	O
the	O
most	O
popular	O
implementation	O
,	O
several	O
other	O
implementations	O
have	O
been	O
developed	O
.	O
</s>
<s>
Some	O
of	O
these	O
are	O
compilers	B-Language
or	O
support	O
JIT	O
compilation	B-Language
,	O
and	O
hence	O
offer	O
performance	O
benefits	O
over	O
Zend	O
PHP	B-Application
at	O
the	O
expense	O
of	O
lacking	O
full	O
PHP	B-Application
compatibility	O
.	O
</s>
<s>
HHVM	B-Language
(	O
HipHop	B-Language
Virtual	I-Language
Machine	I-Language
)	O
–	O
developed	O
at	O
Facebook	O
and	O
available	O
as	O
open	O
source	O
,	O
it	O
converts	O
PHP	B-Application
code	O
into	O
a	O
high-level	O
bytecode	O
(	O
commonly	O
known	O
as	O
an	O
intermediate	O
language	O
)	O
,	O
which	O
is	O
then	O
translated	O
into	O
x86-64	B-Device
machine	O
code	O
dynamically	O
at	O
runtime	O
by	O
a	O
just-in-time	O
(	O
JIT	O
)	O
compiler	B-Language
,	O
resulting	O
in	O
up	O
to	O
6×	O
performance	O
improvements	O
.	O
</s>
<s>
However	O
,	O
since	O
version	O
7.2	O
Zend	O
has	O
outperformed	O
HHVM	B-Language
,	O
and	O
HHVM	B-Language
3.24	O
is	O
the	O
last	O
version	O
to	O
officially	O
support	O
PHP	B-Application
.	O
</s>
<s>
HipHop	B-Language
–	O
developed	O
at	O
Facebook	O
and	O
available	O
as	O
open	O
source	O
,	O
it	O
transforms	O
the	O
PHP	B-Application
scripts	I-Application
into	O
C++	B-Language
code	I-Language
and	O
then	O
compiles	B-Language
the	O
resulting	O
code	O
,	O
reducing	O
the	O
server	O
load	O
up	O
to	O
50%	O
.	O
</s>
<s>
In	O
early	O
2013	O
,	O
Facebook	O
deprecated	O
it	O
in	O
favour	O
of	O
HHVM	B-Language
due	O
to	O
multiple	O
reasons	O
,	O
including	O
deployment	O
difficulties	O
and	O
lack	O
of	O
support	O
for	O
the	O
whole	O
PHP	B-Application
language	I-Application
,	O
including	O
the	O
create_function( )	O
and	O
eval( )	O
constructs	O
.	O
</s>
<s>
Parrot	B-Language
–	O
a	O
virtual	O
machine	O
designed	O
to	O
run	O
dynamic	O
languages	O
efficiently	O
;	O
the	O
cross-translator	O
Pipp	O
transforms	O
the	O
PHP	B-Application
source	O
code	O
into	O
the	O
Parrot	B-Language
intermediate	I-Language
representation	I-Language
,	O
which	O
is	O
then	O
translated	O
into	O
the	O
Parrot	B-Language
's	O
bytecode	O
and	O
executed	B-General_Concept
by	O
the	O
virtual	O
machine	O
.	O
</s>
<s>
PHP	B-Application
is	O
free	B-Application
software	I-Application
released	O
under	O
the	O
PHP	B-Language
License	I-Language
,	O
which	O
stipulates	O
that	O
:	O
</s>
<s>
This	O
restriction	O
on	O
the	O
use	O
of	O
"	O
PHP	B-Application
"	O
makes	O
the	O
PHP	B-Language
License	I-Language
incompatible	O
with	O
the	O
General	B-License
Public	I-License
License	I-License
(	O
GPL	B-License
)	O
,	O
while	O
the	O
Zend	O
License	O
is	O
incompatible	O
due	O
to	O
an	O
advertising	O
clause	O
similar	O
to	O
that	O
of	O
the	O
original	O
BSD	B-Operating_System
license	I-Operating_System
.	O
</s>
<s>
PHP	B-Application
includes	O
various	O
free	B-Language
and	I-Language
open-source	I-Language
libraries	I-Language
in	O
its	O
source	O
distribution	O
or	O
uses	O
them	O
in	O
resulting	O
PHP	B-Application
binary	O
builds	O
.	O
</s>
<s>
PHP	B-Application
is	O
fundamentally	O
an	O
Internet-aware	O
system	O
with	O
built-in	O
modules	O
for	O
accessing	O
File	B-Protocol
Transfer	I-Protocol
Protocol	I-Protocol
(	O
FTP	O
)	O
servers	O
and	O
many	O
database	O
servers	O
,	O
including	O
PostgreSQL	B-Application
,	O
MySQL	B-Application
,	O
Microsoft	B-Application
SQL	I-Application
Server	I-Application
and	O
SQLite	B-Language
(	O
which	O
is	O
an	O
embedded	O
database	O
)	O
,	O
LDAP	B-Protocol
servers	O
,	O
and	O
others	O
.	O
</s>
<s>
Numerous	O
functions	O
are	O
familiar	O
to	O
C	B-Language
programmers	B-Application
,	O
such	O
as	O
those	O
in	O
the	O
stdio	B-Language
family	O
,	O
are	O
available	O
in	O
standard	O
PHP	B-Application
builds	O
.	O
</s>
<s>
PHP	B-Application
allows	O
developers	B-Application
to	O
write	O
extensions	B-Application
in	O
C	B-Language
to	O
add	O
functionality	O
to	O
the	O
PHP	B-Application
language	I-Application
.	O
</s>
<s>
PHP	B-Application
extensions	B-Application
can	O
be	O
compiled	B-Language
statically	O
into	O
PHP	B-Application
or	O
loaded	O
dynamically	O
at	O
runtime	O
.	O
</s>
<s>
Numerous	O
extensions	B-Application
have	O
been	O
written	O
to	O
add	O
support	O
for	O
the	O
Windows	B-Library
API	I-Library
,	O
process	O
management	O
on	O
Unix-like	B-Operating_System
operating	I-Operating_System
systems	I-Operating_System
,	O
multibyte	O
strings	O
(	O
Unicode	O
)	O
,	O
cURL	B-Language
,	O
and	O
several	O
popular	O
compression	B-General_Concept
formats	I-General_Concept
.	O
</s>
<s>
Other	O
PHP	B-Application
features	O
made	O
available	O
through	O
extensions	B-Application
include	O
integration	O
with	O
Internet	B-Protocol
Relay	I-Protocol
Chat	I-Protocol
(	O
IRC	B-Protocol
)	O
,	O
dynamic	O
generation	O
of	O
images	O
and	O
Adobe	B-Operating_System
Flash	I-Operating_System
content	O
,	O
PHP	B-Application
Data	O
Objects	O
(	O
PDO	O
)	O
as	O
an	O
abstraction	O
layer	O
used	O
for	O
accessing	O
databases	O
,	O
and	O
even	O
speech	B-Application
synthesis	I-Application
.	O
</s>
<s>
Some	O
of	O
the	O
language	O
's	O
core	O
functions	O
,	O
such	O
as	O
those	O
dealing	O
with	O
strings	O
and	O
arrays	O
,	O
are	O
also	O
implemented	O
as	O
extensions	B-Application
.	O
</s>
<s>
The	O
PHP	B-Application
Extension	O
Community	O
Library	O
(	O
PECL	O
)	O
project	O
is	O
a	O
repository	O
for	O
extensions	B-Application
to	O
the	O
PHP	B-Application
language	I-Application
.	O
</s>
<s>
Some	O
other	O
projects	O
,	O
such	O
as	O
Zephir	O
,	O
provide	O
the	O
ability	O
for	O
PHP	B-Application
extensions	B-Application
to	O
be	O
created	O
in	O
a	O
high-level	O
language	O
and	O
compiled	B-Language
into	O
native	O
PHP	B-Application
extensions	B-Application
.	O
</s>
<s>
Such	O
an	O
approach	O
,	O
instead	O
of	O
writing	O
PHP	B-Application
extensions	B-Application
directly	O
in	O
C	B-Language
,	O
simplifies	O
the	O
development	O
of	O
extensions	B-Application
and	O
reduces	O
the	O
time	O
required	O
for	O
programming	O
and	O
testing	O
.	O
</s>
<s>
By	O
December	O
2018	O
the	B-Application
PHP	I-Application
Group	I-Application
consisted	O
of	O
ten	O
people	O
:	O
Thies	O
C	B-Language
.	O
Arntzen	O
,	O
Stig	O
Bakken	O
,	O
Shane	O
Caraveo	O
,	O
Andi	O
Gutmans	O
,	O
Rasmus	O
Lerdorf	O
,	O
Sam	O
Ruby	O
,	O
Sascha	O
Schumann	O
,	O
Zeev	O
Suraski	O
,	O
Jim	O
Winstead	O
,	O
and	O
Andrei	B-Language
Zmievski	I-Language
.	O
</s>
<s>
Zend	O
Technologies	O
provides	O
a	O
PHP	B-Application
Certification	O
based	O
on	O
PHP7	O
exam	O
(	O
and	O
previously	O
based	O
on	O
PHP5.5	O
)	O
for	O
programmers	B-Application
to	O
become	O
certified	O
PHP	B-Application
developers	B-Application
.	O
</s>
<s>
On	O
November	O
26	O
,	O
2021	O
,	O
the	O
JetBrains	O
blog	O
announced	O
the	O
creation	O
of	O
the	O
PHP	B-Application
Foundation	O
,	O
which	O
will	O
sponsor	O
the	O
design	O
and	O
development	O
of	O
PHP	B-Application
.	O
</s>
<s>
There	O
are	O
two	O
primary	O
ways	O
for	O
adding	O
support	O
for	O
PHP	B-Application
to	O
a	O
web	B-Application
server	I-Application
–	O
as	O
a	O
native	O
web	B-Application
server	I-Application
module	B-Application
,	O
or	O
as	O
a	O
CGI	O
executable	O
.	O
</s>
<s>
PHP	B-Application
has	O
a	O
direct	O
module	B-Application
interface	O
called	O
server	B-General_Concept
application	I-General_Concept
programming	I-General_Concept
interface	I-General_Concept
(	O
SAPI	O
)	O
,	O
which	O
is	O
supported	O
by	O
many	O
web	B-Application
servers	I-Application
including	O
Apache	B-Application
HTTP	I-Application
Server	I-Application
,	O
Microsoft	B-Application
IIS	I-Application
and	O
iPlanet	B-Language
Web	I-Language
Server	I-Language
.	O
</s>
<s>
Some	O
other	O
web	B-Application
servers	I-Application
,	O
such	O
as	O
OmniHTTPd	O
,	O
support	O
the	O
Internet	B-Library
Server	I-Library
Application	I-Library
Programming	I-Library
Interface	I-Library
(	O
ISAPI	B-Library
)	O
,	O
which	O
is	O
Microsoft	O
's	O
web	B-Application
server	I-Application
module	B-Application
interface	O
.	O
</s>
<s>
If	O
PHP	B-Application
has	O
no	O
module	B-Application
support	O
for	O
a	O
web	B-Application
server	I-Application
,	O
it	O
can	O
always	O
be	O
used	O
as	O
a	O
Common	B-Language
Gateway	I-Language
Interface	I-Language
(	O
CGI	O
)	O
or	O
FastCGI	O
processor	O
;	O
in	O
that	O
case	O
,	O
the	O
web	B-Application
server	I-Application
is	O
configured	O
to	O
use	O
PHP	B-Application
's	O
CGI	O
executable	O
to	O
process	O
all	O
requests	O
to	O
PHP	B-Application
files	O
.	O
</s>
<s>
PHP-FPM	O
(	O
FastCGI	O
Process	O
Manager	O
)	O
is	O
an	O
alternative	O
FastCGI	O
implementation	O
for	O
PHP	B-Application
,	O
bundled	O
with	O
the	O
official	O
PHP	B-Application
distribution	O
since	O
version	O
5.3.3	O
.	O
</s>
<s>
When	O
compared	O
to	O
the	O
older	O
FastCGI	O
implementation	O
,	O
it	O
contains	O
some	O
additional	O
features	O
,	O
mostly	O
useful	O
for	O
heavily	O
loaded	O
web	B-Application
servers	I-Application
.	O
</s>
<s>
When	O
using	O
PHP	B-Application
for	O
command-line	B-Application
scripting	O
,	O
a	O
PHP	B-Application
command-line	B-Application
interface	I-Application
(	O
CLI	O
)	O
executable	O
is	O
needed	O
.	O
</s>
<s>
PHP	B-Application
supports	O
a	O
CLI	O
server	B-General_Concept
application	I-General_Concept
programming	I-General_Concept
interface	I-General_Concept
(	O
SAPI	O
)	O
since	O
PHP4.3.0	O
.	O
</s>
<s>
The	O
main	O
focus	O
of	O
this	O
SAPI	O
is	O
developing	O
shell	B-Application
applications	O
using	O
PHP	B-Application
.	O
</s>
<s>
PHP	B-Application
has	O
a	O
direct	O
module	B-Application
interface	O
called	O
SAPI	O
for	O
different	O
web	B-Application
servers	I-Application
;	O
in	O
case	O
of	O
PHP5	O
and	O
Apache2.0	O
on	O
Windows	B-Application
,	O
it	O
is	O
provided	O
in	O
form	O
of	O
a	O
DLL	O
file	O
called	O
,	O
which	O
is	O
a	O
module	B-Application
that	O
,	O
among	O
other	O
functions	O
,	O
provides	O
an	O
interface	O
between	O
PHP	B-Application
and	O
the	O
web	B-Application
server	I-Application
,	O
implemented	O
in	O
a	O
form	O
that	O
the	O
server	O
understands	O
.	O
</s>
<s>
There	O
are	O
different	O
kinds	O
of	O
SAPIs	O
for	O
various	O
web	B-Application
server	I-Application
extensions	B-Application
.	O
</s>
<s>
For	O
example	O
,	O
in	O
addition	O
to	O
those	O
listed	O
above	O
,	O
other	O
SAPIs	O
for	O
the	O
PHP	B-Application
language	I-Application
include	O
the	O
Common	B-Language
Gateway	I-Language
Interface	I-Language
and	O
command-line	B-Application
interface	I-Application
.	O
</s>
<s>
PHP	B-Application
can	O
also	O
be	O
used	O
for	O
writing	O
desktop	O
graphical	B-Application
user	I-Application
interface	I-Application
(	O
GUI	B-Application
)	O
applications	O
,	O
by	O
using	O
the	O
PHP-GTK	B-Language
extension	O
.	O
</s>
<s>
PHP-GTK	B-Language
is	O
not	O
included	O
in	O
the	O
official	O
PHP	B-Application
distribution	O
,	O
and	O
as	O
an	O
extension	O
,	O
it	O
can	O
be	O
used	O
only	O
with	O
PHP	B-Application
versions	O
5.1.0	O
and	O
newer	O
.	O
</s>
<s>
The	O
most	O
common	O
way	O
of	O
installing	O
PHP-GTK	B-Language
is	O
by	O
compiling	B-Language
it	O
from	O
the	O
source	O
code	O
.	O
</s>
<s>
When	O
PHP	B-Application
is	O
installed	O
and	O
used	O
in	O
cloud	B-Architecture
environments	O
,	O
software	B-Application
development	I-Application
kits	I-Application
(	O
SDKs	O
)	O
are	O
provided	O
for	O
using	O
cloud-specific	O
features	O
.	O
</s>
<s>
Microsoft	B-Application
Azure	I-Application
can	O
be	O
used	O
with	O
the	O
Windows	B-Application
Azure	I-Application
SDK	O
for	O
PHP	B-Application
.	O
</s>
<s>
Numerous	O
configuration	O
options	O
are	O
supported	O
,	O
affecting	O
both	O
core	O
PHP	B-Application
features	O
and	O
extensions	B-Application
.	O
</s>
<s>
Configuration	O
file	O
php.ini	O
is	O
searched	O
for	O
in	O
different	O
locations	O
,	O
depending	O
on	O
the	O
way	O
PHP	B-Application
is	O
used	O
.	O
</s>
<s>
The	O
configuration	O
file	O
is	O
split	O
into	O
various	O
sections	O
,	O
while	O
some	O
of	O
the	O
configuration	O
options	O
can	O
be	O
also	O
set	O
within	O
the	O
web	B-Application
server	I-Application
configuration	O
.	O
</s>
<s>
PHP	B-Application
is	O
a	O
general-purpose	B-Language
scripting	B-Language
language	I-Language
that	O
is	O
especially	O
suited	O
to	O
server-side	B-Language
web	O
development	O
,	O
in	O
which	O
case	O
PHP	B-Application
generally	O
runs	O
on	O
a	O
web	B-Application
server	I-Application
.	O
</s>
<s>
Any	O
PHP	B-Application
code	O
in	O
a	O
requested	O
file	O
is	O
executed	B-General_Concept
by	O
the	O
PHP	B-Application
runtime	O
,	O
usually	O
to	O
create	O
dynamic	O
web	O
page	O
content	O
or	O
dynamic	O
images	O
used	O
on	O
websites	O
or	O
elsewhere	O
.	O
</s>
<s>
It	O
can	O
also	O
be	O
used	O
for	O
command-line	B-Application
scripting	O
and	O
client-side	B-Operating_System
graphical	B-Application
user	I-Application
interface	I-Application
(	O
GUI	B-Application
)	O
applications	O
.	O
</s>
<s>
PHP	B-Application
can	O
be	O
deployed	O
on	O
most	O
web	B-Application
servers	I-Application
,	O
many	O
operating	B-General_Concept
systems	I-General_Concept
and	O
platforms	B-Device
,	O
and	O
can	O
be	O
used	O
with	O
many	O
relational	B-Application
database	I-Application
management	I-Application
systems	I-Application
(	O
RDBMS	O
)	O
.	O
</s>
<s>
Most	O
web	O
hosting	O
providers	O
support	O
PHP	B-Application
for	O
use	O
by	O
their	O
clients	O
.	O
</s>
<s>
It	O
is	O
available	O
free	O
of	O
charge	O
,	O
and	O
the	B-Application
PHP	I-Application
Group	I-Application
provides	O
the	O
complete	O
source	O
code	O
for	O
users	O
to	O
build	O
,	O
customize	O
and	O
extend	O
for	O
their	O
own	O
use	O
.	O
</s>
<s>
Originally	O
designed	O
to	O
create	O
dynamic	O
web	O
pages	O
,	O
PHP	B-Application
now	O
focuses	O
mainly	O
on	O
server-side	B-Language
scripting	I-Language
,	O
and	O
it	O
is	O
similar	O
to	O
other	O
server-side	B-Language
scripting	I-Language
languages	O
that	O
provide	O
dynamic	O
content	O
from	O
a	O
web	B-Application
server	I-Application
to	O
a	O
client	B-Protocol
,	O
such	O
as	O
Microsoft	O
's	O
ASP.NET	B-Application
,	O
Sun	O
Microsystems	O
 '	O
JavaServer	B-Language
Pages	I-Language
,	O
and	O
mod_perl	O
.	O
</s>
<s>
PHP	B-Application
has	O
also	O
attracted	O
the	O
development	O
of	O
many	O
software	B-Architecture
frameworks	I-Architecture
that	O
provide	O
building	O
blocks	O
and	O
a	O
design	O
structure	O
to	O
promote	O
rapid	O
application	O
development	O
(	O
RAD	O
)	O
.	O
</s>
<s>
Some	O
of	O
these	O
include	O
PRADO	B-Language
,	O
CakePHP	B-Language
,	O
Symfony	B-Language
,	O
CodeIgniter	B-Language
,	O
Laravel	B-Language
,	O
Yii	B-Language
Framework	I-Language
,	O
Phalcon	B-Language
and	O
Laminas	B-Language
,	O
offering	O
features	O
similar	O
to	O
other	O
web	B-Application
frameworks	I-Application
.	O
</s>
<s>
The	O
LAMP	B-Application
architecture	I-Application
has	O
become	O
popular	O
in	O
the	O
web	O
industry	O
as	O
a	O
way	O
of	O
deploying	O
web	O
applications	O
.	O
</s>
<s>
PHP	B-Application
is	O
commonly	O
used	O
as	O
the	O
P	O
in	O
this	O
bundle	O
alongside	O
Linux	B-Application
,	O
Apache	B-Application
and	O
MySQL	B-Application
,	O
although	O
the	O
P	O
may	O
also	O
refer	O
to	O
Python	B-Language
,	O
Perl	B-Language
,	O
or	O
some	O
mix	O
of	O
the	O
three	O
.	O
</s>
<s>
Similar	O
packages	O
,	O
WAMP	O
and	O
MAMP	B-Protocol
,	O
are	O
also	O
available	O
for	O
Windows	B-Application
and	O
macOS	B-Application
,	O
with	O
the	O
first	O
letter	O
standing	O
for	O
the	O
respective	O
operating	B-General_Concept
system	I-General_Concept
.	O
</s>
<s>
Although	O
both	O
PHP	B-Application
and	O
Apache	B-Application
are	O
provided	O
as	O
part	O
of	O
the	O
macOS	B-Application
base	O
install	O
,	O
users	O
of	O
these	O
packages	O
seek	O
a	O
simpler	O
installation	O
mechanism	O
that	O
can	O
be	O
more	O
easily	O
kept	O
up	O
to	O
date	O
.	O
</s>
<s>
For	O
specific	O
and	O
more	O
advanced	O
usage	O
scenarios	O
,	O
PHP	B-Application
offers	O
a	O
well-defined	O
and	O
documented	O
way	O
for	O
writing	O
custom	O
extensions	B-Application
in	O
C	B-Language
or	O
C++	B-Language
.	O
</s>
<s>
Besides	O
extending	O
the	O
language	O
itself	O
in	O
form	O
of	O
additional	O
libraries	B-Library
,	O
extensions	B-Application
are	O
providing	O
a	O
way	O
for	O
improving	O
execution	O
speed	O
where	O
it	O
is	O
critical	O
and	O
there	O
is	O
room	O
for	O
improvements	O
by	O
using	O
a	O
true	O
compiled	B-Language
language	I-Language
.	O
</s>
<s>
PHP	B-Application
also	O
offers	O
well-defined	O
ways	O
for	O
embedding	O
itself	O
into	O
other	O
software	O
projects	O
.	O
</s>
<s>
That	O
way	O
PHP	B-Application
can	O
be	O
easily	O
used	O
as	O
an	O
internal	O
scripting	B-Language
language	I-Language
for	O
another	O
project	O
,	O
also	O
providing	O
tight	O
interfacing	O
with	O
the	O
project	O
's	O
specific	O
internal	O
data	B-General_Concept
structures	I-General_Concept
.	O
</s>
<s>
PHP	B-Application
received	O
mixed	O
reviews	O
due	O
to	O
lacking	O
support	O
for	O
multithreading	B-Operating_System
at	O
the	O
core	O
language	O
level	O
,	O
though	O
using	O
threads	B-Operating_System
is	O
made	O
possible	O
by	O
the	O
"	O
pthreads	O
"	O
PECL	O
extension	O
.	O
</s>
<s>
A	O
command	B-Application
line	I-Application
interface	I-Application
,	O
php-cli	O
,	O
and	O
two	O
ActiveX	B-Application
Windows	B-Application
Script	O
Host	O
scripting	B-Language
engines	I-Language
for	O
PHP	B-Application
have	O
been	O
produced	O
.	O
</s>
<s>
PHP	B-Application
is	O
used	O
for	O
Web	O
content	B-Protocol
management	I-Protocol
systems	I-Protocol
including	O
MediaWiki	B-Application
,	O
WordPress	B-Application
,	O
Joomla	B-Protocol
,	O
Drupal	B-Application
,	O
Moodle	B-Application
,	O
eZ	B-Application
Publish	I-Application
,	O
eZ	B-Application
Platform	I-Application
,	O
and	O
SilverStripe	B-Application
.	O
</s>
<s>
,	O
PHP	B-Application
was	O
used	O
in	O
more	O
than	O
240million	O
websites	O
(	O
39%	O
of	O
those	O
sampled	O
)	O
and	O
was	O
installed	O
on	O
2.1million	O
web	B-Application
servers	I-Application
.	O
</s>
<s>
,	O
PHP	B-Application
was	O
used	O
as	O
the	O
server-side	B-Language
programming	I-Language
language	O
on	O
79.1	O
%	O
of	O
websites	O
,	O
down	O
from	O
83.5	O
%	O
previously	O
,	O
where	O
the	O
language	O
could	O
be	O
determined	O
,	O
and	O
PHP	B-Application
7	O
is	O
the	O
most	O
used	O
version	O
of	O
the	O
language	O
with	O
50.3	O
%	O
of	O
all	O
websites	O
on	O
the	O
web	O
using	O
that	O
version	O
.	O
</s>
<s>
In	O
2019	O
,	O
11%	O
of	O
all	O
vulnerabilities	O
listed	O
by	O
the	O
National	O
Vulnerability	O
Database	O
were	O
linked	O
to	O
PHP	B-Application
;	O
historically	O
,	O
about	O
30%	O
of	O
all	O
vulnerabilities	O
listed	O
since	O
1996	O
in	O
this	O
database	O
are	O
linked	O
to	O
PHP	B-Application
.	O
</s>
<s>
Technical	O
security	O
flaws	O
of	O
the	O
language	O
itself	O
or	O
of	O
its	O
core	O
libraries	B-Library
are	O
not	O
frequent	O
(	O
22	O
in	O
2009	O
,	O
about	O
1%	O
of	O
the	O
total	O
although	O
PHP	B-Application
applies	O
to	O
about	O
20%	O
of	O
programs	O
listed	O
)	O
.	O
</s>
<s>
Recognizing	O
that	O
programmers	B-Application
make	O
mistakes	O
,	O
some	O
languages	O
include	O
taint	O
checking	O
to	O
automatically	O
detect	O
the	O
lack	O
of	O
input	O
validation	O
which	O
induces	O
many	O
issues	O
.	O
</s>
<s>
Such	O
a	O
feature	O
is	O
being	O
developed	O
for	O
PHP	B-Application
,	O
but	O
its	O
inclusion	O
into	O
a	O
release	O
has	O
been	O
rejected	O
several	O
times	O
in	O
the	O
past	O
.	O
</s>
<s>
There	O
are	O
advanced	O
protection	O
patches	O
such	O
as	O
Suhosin	B-Language
and	O
Hardening-Patch	O
,	O
specially	O
designed	O
for	O
web	O
hosting	O
environments	O
.	O
</s>
<s>
Historically	O
,	O
old	O
versions	O
of	O
PHP	B-Application
had	O
some	O
configuration	O
parameters	O
and	O
default	O
values	O
for	O
such	O
runtime	O
settings	O
that	O
made	O
some	O
PHP	B-Application
applications	O
prone	O
to	O
security	O
issues	O
.	O
</s>
<s>
Among	O
these	O
,	O
magic_quotes_gpc	B-Language
and	O
register_globals	O
configuration	O
directives	O
were	O
the	O
best	O
known	O
;	O
the	O
latter	O
made	O
any	O
URL	O
parameters	O
become	O
PHP	B-Application
variables	I-Application
,	O
opening	O
a	O
path	O
for	O
serious	O
security	O
vulnerabilities	O
by	O
allowing	O
an	O
attacker	O
to	O
set	O
the	O
value	O
of	O
any	O
uninitialized	O
global	O
variable	O
and	O
interfere	O
with	O
the	O
execution	O
of	O
a	O
PHP	B-Application
script	I-Application
.	O
</s>
<s>
Support	O
for	O
"	O
magic	B-Language
quotes	I-Language
"	O
and	O
"	O
register	O
globals	O
"	O
settings	O
has	O
been	O
deprecated	O
since	O
PHP5.3.0	O
,	O
and	O
removed	O
from	O
PHP5.4.0	O
.	O
</s>
<s>
Another	O
example	O
for	O
the	O
potential	O
runtime-settings	O
vulnerability	O
comes	O
from	O
failing	O
to	O
disable	O
PHP	B-Application
execution	O
(	O
for	O
example	O
by	O
using	O
the	O
engine	O
configuration	O
directive	O
)	O
for	O
the	O
directory	O
where	O
uploaded	O
files	O
are	O
stored	O
;	O
enabling	O
it	O
can	O
result	O
in	O
the	O
execution	O
of	O
malicious	O
code	O
embedded	O
within	O
the	O
uploaded	O
files	O
.	O
</s>
<s>
The	O
best	O
practice	O
is	O
to	O
either	O
locate	O
the	O
image	O
directory	O
outside	O
of	O
the	O
document	O
root	O
available	O
to	O
the	O
web	B-Application
server	I-Application
and	O
serve	O
it	O
via	O
an	O
intermediary	O
script	O
or	O
disable	O
PHP	B-Application
execution	O
for	O
the	O
directory	O
which	O
stores	O
the	O
uploaded	O
files	O
.	O
</s>
<s>
Also	O
,	O
enabling	O
the	O
dynamic	O
loading	O
of	O
PHP	B-Application
extensions	B-Application
(	O
via	O
enable_dl	O
configuration	O
directive	O
)	O
in	O
a	O
shared	O
web	O
hosting	O
environment	O
can	O
lead	O
to	O
security	O
issues	O
.	O
</s>
<s>
Implied	O
type	O
conversions	O
that	O
result	O
in	O
different	O
values	O
being	O
treated	O
as	O
equal	O
,	O
sometimes	O
against	O
the	O
programmer	B-Application
's	O
intent	O
,	O
can	O
lead	O
to	O
security	O
issues	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
result	O
of	O
the	O
comparison	O
is	O
true	O
,	O
because	O
strings	O
that	O
are	O
parsable	B-Language
as	O
numbers	O
are	O
converted	O
to	O
numbers	O
;	O
in	O
this	O
case	O
,	O
the	O
first	O
compared	O
value	O
is	O
treated	O
as	O
scientific	O
notation	O
having	O
the	O
value	O
(	O
)	O
,	O
which	O
is	O
zero	O
.	O
</s>
<s>
Errors	O
like	O
this	O
resulted	O
in	O
authentication	O
vulnerabilities	O
in	O
Simple	B-Protocol
Machines	I-Protocol
Forum	I-Protocol
,	O
Typo3	B-Protocol
and	O
phpBB	B-Application
when	O
MD5	B-Algorithm
password	O
hashes	B-Algorithm
were	O
compared	O
.	O
</s>
<s>
In	O
a	O
2013	O
analysis	O
of	O
over	O
170,000	O
website	O
defacements	O
,	O
published	O
by	O
Zone-H	O
,	O
the	O
most	O
frequently	O
(	O
53%	O
)	O
used	O
technique	O
was	O
the	O
exploitation	O
of	O
file-inclusion	O
vulnerability	O
,	O
mostly	O
related	O
to	O
insecure	O
usage	O
of	O
the	O
PHP	B-Application
language	I-Application
constructs	O
include	O
,	O
require	O
,	O
and	O
allow_url_fopen	O
.	O
</s>
<s>
of	O
all	O
PHP	B-Application
websites	O
using	O
version	O
5.6	O
or	O
older	O
.	O
</s>
<s>
It	O
is	O
highly	O
recommended	O
to	O
migrate	O
to	O
PHP	B-Application
version	O
7	O
or	O
8	O
and	O
use	O
random_int( )	O
instead	O
of	O
rand( )	O
or	O
mt_rand( )	O
,	O
as	O
the	O
latter	O
functions	O
are	O
not	O
cryptographically-secure	O
.	O
</s>
<s>
There	O
are	O
two	O
attacks	O
that	O
can	O
be	O
performed	O
over	O
PHP	B-Application
entropy	O
sources	O
:	O
"	O
seed	O
attack	O
"	O
and	O
"	O
state	O
recovery	O
attack	O
"	O
.	O
</s>
<s>
With	O
current	O
GPU	O
technologies	O
,	O
an	O
attacker	O
can	O
perform	O
up	O
to	O
2	O
MD5	B-Algorithm
calculations	O
per	O
second	O
with	O
a	O
$250	O
GPU	O
,	O
while	O
with	O
an	O
additional	O
$500	O
can	O
reach	O
up	O
to	O
2	O
calculations	O
.	O
</s>
