The PHP manual lists ten primitive data types in three groups.
Group
Type
Example
Scalar
string
“Hello PHP!”
Scalar
integer
2567
Scalar
float (double)
1.5 or 134.153
Scalar
boolean
true or false
Compound
array
[1, 2, 3]
Compound
object
An instance of a class
Compound
callable
A function that can be called
Compound
iterable
An array or an object that can be looped
Special
NULL
A variable with no value
Special
resource
A reference to an outside thing, like an open file
In PHP you do not write the type when you create a variable. PHP picks it from the value. You can check it with var_dump() or gettype(). Learn all of them with examples in PHP Data Types.