在PHP中的点运算符(Dot operator in PHP)
我以为我认识字符串操作符 . 直到今天我被问及一个关于它的问题。 这个问题看起来很简单:
echo 100...100;乍一看,我认为这会造成语法错误。 但是当我运行代码并看到结果时,我完全困惑。 结果是
1000.1所以我想知道这是怎么发生的?
谢谢。
I thought I've known the String Operator . well enough until I was asked a question about it today. The question looks quite simple:
echo 100...100;At the first glance I thought it would make a syntax error. But when I ran the code and saw the result I was totally confused. The result is
1000.1So I wonder how could this happen?
Thanks.
最满意答案
像这样读取它:
(100.) . (.100)因此它连接100和0.1 。
Read it like this:
(100.) . (.100)Thus it concats 100 and 0.1.
更多推荐
发布评论