What’s the maximum value for an int in PHP?

From the PHP manual: The size of an integer is platform-dependent, although a maximum value of about two billion is the usual value (that’s 32 bits signed). PHP does not support unsigned integers. Integer size can be determined using the constant PHP_INT_SIZE, and maximum value using the constant PHP_INT_MAX since PHP 4.4.0 and PHP 5.0.5. … Read more

What is the difference between “int” and “uint” / “long” and “ulong”?

The primitive data types prefixed with “u” are unsigned versions with the same bit sizes. Effectively, this means they cannot store negative numbers, but on the other hand they can store positive numbers twice as large as their signed counterparts. The signed counterparts do not have “u” prefixed. The limits for int (32 bit) are: … Read more

Why write 1,000,000,000 as 1000*1000*1000 in C?

One reason to declare constants in a multiplicative way is to improve readability, while the run-time performance is not affected. Also, to indicate that the writer was thinking in a multiplicative manner about the number. Consider this: double memoryBytes = 1024 * 1024 * 1024; It’s clearly better than: double memoryBytes = 1073741824; as the … Read more