Search code examples
phpcomparison

Interview question: In php, is 123==0123?


I have answered it is false. then he asked why? i couldn't answer. Can anyone make the answer? I am very interested to learn it.


Solution

  • Prefixing a number with 0 indicates octal (base 8), much the same way 0x indicates hex (base 16).