What "|" character do?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/3737139/reference-what-does-this-symbol-mean-in-php">Reference - What does this symbol mean in PHP?</a>  </p>
</blockquote>



<p>I googled much for finding answer but i couldn't find any.
I saw in few free source codes that they use "|" sign to combine values or something. can someone enlighten what is different between "|" and "+"?</p>

<p>sample:</p>

<pre><code>&lt;?php
define('PERMISSION_DENIED', 0);
define('PERMISSION_READ', 1);
define('PERMISSION_ADD',  2);
define('PERMISSION_UPDATE', 4);
define('PERMISSION_DELETE', 8);


$read_only = PERMISSION_READ;
$read_delete = PERMISSION_READ | PERMISSION_DELETE;
$full_rights = PERMISSION_DENIED | PERMISSION_READ | PERMISSION_ADD | PERMISSION_UPDATE | PERMISSION_DELETE;


$myrights = PERMISSION_READ;
$myrights |= PERMISSION_UPDATE; 
?&gt;
</code></pre>

<p>why not just:</p>

<pre><code>&lt;?php
define('PERMISSION_DENIED', 0);
define('PERMISSION_READ', 1);
define('PERMISSION_ADD',  2);
define('PERMISSION_UPDATE', 4);
define('PERMISSION_DELETE', 8);


$read_only = PERMISSION_READ;
$read_delete = PERMISSION_READ + PERMISSION_DELETE;
$full_rights = PERMISSION_DENIED + PERMISSION_READ + PERMISSION_ADD + PERMISSION_UPDATE + PERMISSION_DELETE;


$myrights = PERMISSION_READ;
$myrights += PERMISSION_UPDATE; 
?&gt;
</code></pre>
