Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果您不得不猜测以下 php 代码的输出是什么:
$str = "011"; eval("\$num = $str;"); echo "number is: ".$num;
我敢打赌你永远不会说“9”。好吧,我也没有…… 我很想听听对这种奇怪行为的解释!
以 0 开头的数字表示基数为 8,其中 11 为 9。
还在迷茫吗?阅读:http ://en.wikipedia.org/wiki/Octal