开发者

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

开发者 https://www.devze.com 2023-03-29 12:34 出处:网络
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.

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 it.

$showPlayer |= isset($params['node开发者_Go百科']) && $params['node'];


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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消