compare bitwise and & logical and in php

It is for static page, dynamic page, website, SEO, performance and other web development discussion
Joshi jahanvi

compare bitwise and & logical and in php

Postby Joshi jahanvi » Fri Oct 31, 2014 2:55 pm

what the difference between the 'BITWISE AND' operator and the 'LOGICAL AND' operator?


sonall gajera

Re: compare bitwise and & logical and in php

Postby sonall gajera » Tue Jul 07, 2015 11:26 am

PHP Logical Operators PHP Bitwise Operators

Operator Name Description Operator Name Description
a and b And True if both a and b are true a & b And Bits that are set in both a and b are set.
a or b Or True if either a or b is true a | b Or Bits that are set in either a or b are set
a xor b Xor True if either a or b is true, but not both a ^ b Xor Bits that are set in a or b but not both are set
!a Not True if a is not true ~ a Not Bits that are set in a are not set, and vice versa
a && b And Same as and operator a << b Shift left Shift the bits of a, b steps to the left
a || b Or Same as or operator a >> b Shift right Shift the bits of a, b steps to the right


Return to “PHP, HTML, MYSQL and Web Hosting”

Who is online

Users browsing this forum: No registered users and 2 guests