Jump to content

Bitwise operations: Difference between revisions

Line 336:
}</perl>
=={{header|PHP}}==
<php>function bitwise($a, $b)
{{incorrect|PHP}}
{
<php>echo '$a << $b: ', $a << $b, "\n"; // left shift
echo '$a >>AND $b: ', $a >>& $b, "\n"; // arithmetic right shift</php>
echo '$a OR $b: ', $a | $b, "\n";
echo '$a XOR $b: ', $a ^ $b, "\n";
echo 'NOT $a: ', ~$a, "\n";
<php> echo '$a << $b: ', $a << $b, "\n"; // left shift
echo '$a >> $b: ', $a >> $b, "\n"; // arithmetic right shift
}</php>
 
=={{header|Pop11}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.