带前导零的 int 变量?

2022-01-14 00:00:00 int php octal

为什么下面的结果是 34?它似乎与八进制数无关.

Why is it that following results in 34? It doesn't seem to have anything to do with octal numbers.

intval(042);

推荐答案

但是前导 0 在许多语言中确实表示八进制,就像这里的情况.

but a leading 0 does indicate octal in many languages, as is the case here.

相关文章