Opposite to scalar variables

PHP and C use the term "scalar variables".

Scalar variables are those that contain an integer, float, string, or boolean. The array, object, and resource types are not scalar.

Is there a term that describes variables that are not scalar?

+3


source to share


2 answers


In terms of data type (for PHP, not C):

Most often, a scalar type is a primitive data type. Also, you have composite types (arrays, objects) and other types (resource descriptors) (this datatype classification builds on those from Wikipedia ).

It is NULL

not a scalar in PHP .

This aligns with the groups specified in Types Introduction to the PHP Manual :



And from the PHP manual for is_scalar

function
:

Scalar types are those that contain an integer , float , string, or boolean . The array , object, and resource types are not scalar.

+4


source


In C terminology, the standard distinguishes between scalar types and "aggregate and concatenated types".



Structure and array types form aggregate types. The union type is not an aggregated type. Arithmetic and pointer types form scalar types.

+2


source







All Articles