在PHP中| =是什么意思,那就是管道等于(不是感叹号) [英] In PHP what does |= mean, That is pipe equals (not exclamation)

查看:56
本文介绍了在PHP中| =是什么意思,那就是管道等于(不是感叹号)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是在一些代码中找到了它,而在Web或php手册上却找不到任何东西.很有可能是因为它是不规则字符.

这里是使用它的一行.

$showPlayer |= isset($params['node']) && $params['node'];

解决方案

|=|,就像+=+一样;即$a |= $b;$a = $a | $b;相同. |运算符是按位OR运算符.

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'];

解决方案

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

这篇关于在PHP中| =是什么意思,那就是管道等于(不是感叹号)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆