简体   繁体   中英

Invalid Interger shows in PHP error_log

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM