O'Reilly logo

Core PHP Programming, Third Edition by Leon Atkinson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

2.2. Data Types

PHP has eight different types of values, or data types. The first five are basic: integers, floating-point numbers, strings, booleans, and null. Two others are composed of the basic types, otherwise known as composite types. These include arrays, discussed in Chapter 5, and objects, discussed in Chapter 6. Additionally, the resource type denotes a non-native type, such as an open file or a database connection.

Integers

Integers are whole numbers. The range of integers in PHP is equivalent to the range of the so-called long data type of the C language. Typically, this means they range from –2,147,483,648 to +2,147,483,647 on a 32-bit architecture, but may vary depending on your platform.

PHP allows you to write integers in three ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required