<?php $var1 = 12345; // Positive decimal number $var2 = -12345; // Negative decimal number $var3 = 012345; // Octal number $var4 = 0x12C; // hexadecimal number $var5 = 0b1010; // binary number echo $var1."<br>" ; echo $var2."<br>" ; echo $var3."<br>" ; echo $var4."<br>" ; echo $var5."<br>" ; ?>
Output
12345 -12345 5349 300 10
Size of a integer is platform-dependent. For 32-bit platform its about : 2e9 For 64-bit platform its about : 9e18 |
<?php $var = 0192345; // Octal number with invalid 9 as second digit. echo $var; ?>
Output
1