I'm referring to php mainly, but I know this applies in other languages as well:
Is there a difference between using logical operators and bitwise operators? It seems like using bitwise would always be the most efficient, since it is processed much quicker.
example in quest:
a = 5;
b = 10;
if (a>4 && b<20){
execute code;
} //using two ampersands is logical
if (a>4 & b<20){
execute code;
} //If I am to understand correctly, simply using 1 ampersand is bitwise
//essentially the bitwise condition is asking:
if (1 & 1){execute code;};
//Where both conditions must be true to execute;
Also:
if (1 ^ 0){} //This would also execute;
What would be the difference in using:
if (1 xor 0){};
Realworld application:
if (a>4 ^ b<20){};
OR:
if (a>4 xor b<20){};
 a = 5;
 b = 10;

 if (a>4 && b<20){
 execute code;
 } //using two ampersands is logical

 if (a>4 & b<20){
 execute code;
 } //If I am to understand correctly, simply using 1 ampersand is bitwise

 //essentially the bitwise condition is asking:

 if (1 & 1){execute code;};

 //Where both conditions must be true to execute;

 Also:

 if (1 ^ 0){} //This would also execute;

 What would be the difference in using:

 if (1 xor 0){};

 Realworld application:

 if (a>4 ^ b<20){};

 OR:

 if (a>4 xor b<20){};


If the statement is false, then the computer reads it as a 0, true is 1. (Everything here is written quizzically, not assertions, so correct me if I'm wrong anywhere).
Don't both of these test the exact same logic? If so, when would it ever be better to use logical operators over bitwise operators?
The only things I've seen are situations where bitwise can be more useful than logical operators. So, my main question is there any situation where logical operators are better. Or should one always use bitwise.
Please let me know if my understanding of this is flawed anywhere.
EDIT:
With some testing, I found a situation where logical operators will work and bitwise operators wouldn't:
In binary a float number like 0.5 is read as a 0. So testing it with bitwise will return false, even though it technically isn't. Using logical operators force it to true, before it is processed in binary.
if(0.5  0){execute}; //does not execute; reads 0.5 is 0 in binary
if(0.5  0){execute}; //Logical turns the 0.5 into a 1 (true), so this is executed.
 if(0.5  0){execute}; //does not execute; reads 0.5 is 0 in binary

 if(0.5  0){execute}; //Logical turns the 0.5 into a 1 (true), so this is executed.


It also seems like the bitwise (~) not operator has little to no comparative value.