In PHP what does |= mean, That is pipe equals (not exclamation)

前端 未结 2 611
温柔的废话
温柔的废话 2020-12-03 13:41

I just found this in some code and I can\'t find anything on the web or php manual. Most likely since its an irregular character.

Here is one of the lines that uses

相关标签:
2条回答
  • 2020-12-03 14:07

    |= is to | as += is to +; that is, $a |= $b; is the same as $a = $a | $b;. The | operator is the bitwise OR operator.

    0 讨论(0)
  • 2020-12-03 14:09

    Or-Equals. Similar to saying $var += 2, or $var = $var + 2. In this case, it's $showPlayer = $showPlayer | isset....

    0 讨论(0)
提交回复
热议问题