PHP and C use the term "scalar variables".
Scalar variables are those containing an integer, float, string or boolean. Types array, object and resource are not scalar.
Is there a term that describes the variables that are not scalar?
In terms of the data-type (for PHP, not C):
Most often a scalar type represents a primitive data type. Next, to that, you have composite types (arrays, objects) and other types (resource handles) (this classification of data-types is leaned on the ones from Wikipedia).
In PHP NULL
is not part of the scalars.
This aligns with the groups given in the Types Introduction in the PHP Manual:
And from the PHP manual entry for the is_scalar
function:
Scalar types are those containing an integer, float, string or boolean. Types array, object and resource are not scalar.
In C terminology the Standard distinguishes scalar types and "aggregate and union types".
Structure and array types form the aggregate types. An union type is not of an aggregate type. Arithmetic and pointer types form the scalar types.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With