PHP supports ten primitive types.
Type | Desc | Example |
---|---|---|
Integers | Numbers | 1999, 100 |
Float | floating-point numbers. | 3.1415926 |
Booleans | either true or false | TRUE,FALSE |
NULL | special type | NULL |
Strings | series of characters | "hello php" |
Arrays | an ordered map | array('key'=>'value') |
Iterables | Iterable is a pseudo-type | |
Objects | are instances of programmer-defined classes | $bar = new foo; |
Resources | A resource is a special variable, holding a reference to an external resource. (ie,mysql connections) |
|
Callbacks / Callables | Some functions accept user-defined callback functions as a parameter |