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

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

Posted by: admin November 30, 2017 Leave a comment

Questions:

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']) && $params['node'];
Answers:

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

Questions:
Answers:

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