Jump to content

and operator


maxim

Recommended Posts

if have what will be a easy q for most of you.

 

consider the following code

 

if (0 and 1 > -1) {
print "true";
}

 

that if statment will never be read. im not sure why, my guess is because PHP thinks the 0 is false ??

 

this code how ever will work as expected

if (1 and 0 > -1) {
print "true";
}

 

any one care to explain why. is it precedence ? 

 

Link to comment
https://forums.phpfreaks.com/topic/47828-and-operator/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.