when I try to error_log an integer which has length of 10 and starting from 0 it shows a different value in php error.log
tail -f /var/log/apache2/error.log
I just want to understand why is this happening
with out the 0 in front of the integer error_log()
shows the exact integer I am passing to the error_log()
ex
error_log(0543219878) => 22737 (with 0 in front)
error_log(5543219878) => 5543219878 (without zero)
Can some one please explain this.
Actually your number is consider as octal number. The octal numeral system, or oct for short, is the base-8 number system, and uses the digits 0 to 7. Octal numerals can be made from binary numerals by grouping consecutive binary digits into groups of three (starting from the right).
Hope it will help you out to understand this.
Happy coding.