Monday, 28 May 2012

PHP types


Introduction

PHP supports eight primitive types.

Four scalar types:


boolean
integer
float (floating-point number, aka double)
string


Two compound types:

array
object


And finally three special types:

resource
NULL
callable

This manual also introduces some pseudo-types for readability reasons:

mixed
number
callback
And the pseudo-variable $....

Some references to the type "double" may remain in the manual. Consider double the same as float; the two names exist only for historic reasons.

The type of a variable is not usually set by the programmer; rather, it is decided at runtime by PHP depending on the context in which that variable is used.

No comments:

Post a Comment

Search Engine Submission - AddMe