Jump to content

Difference between && and AND


atitthaker

Recommended Posts

Its all to do with precedence, [b]&&[/b] and [b]||[/b] have a higher precedence than [b]AND[/b] and [b]OR[/b]. I see it like this...
[code]<?php
$a && $b OR $c; //Would be equal to ($a && $b) || $c;
$a AND $b || $c; //Would be equal to $a && ($b || $c);
$a && $b || $c; //Would be equal to ($a && $b) || $c;
?>[/code]
I think it's easier just to use parenthesise...

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.