Friday, November 13, 2009

And != &&

<?

$a = 1;
$b = 0;

$c = $a and $b;
$d = $a && $b;

echo "'$c' != '$d' \n";


Outcome:

'1' != ''


Documented behavior. See http://www.php.net/manual/en/language.operators.precedence.php

No comments:

Post a Comment