This is a collection of questions that come up every now and then about syntax in PHP. This is also a Community Wiki, so everyone is invited to participate in maintaining this list.
It used to be hard to find questions about operators and other syntax tokens.¹
The main idea is to have links to existing questions on Stack Overflow, so it's easier for us to reference them, not to copy over content from …
==和之间有什么区别===?
==比较究竟是如何运作的?===比较究竟是如何运作的?什么是有用的例子?
我一直这样做,if($foo!==$bar)但我意识到这if($foo!=$bar)也是正确的.Double =仍然可以工作,并且一直为我工作,但每当我搜索PHP运算符时,我发现没有关于double的信息,=所以我认为我总是做错了,但它仍然有用.所以,我要改变这一切我!==来!=只是为了它的缘故?
我注意到有人使用PHP操作符===,我无法理解.我已经尝试了一个功能,它以疯狂的方式对应.
这个运算符的定义是什么?我甚至无法在PHP运算符的声明中找到它.