I\'ve seen this a lot: $fp = fopen($filepath, \"w\") or die();
But I can\'t seem to find any real documentation on this \"or\" syntax. It\'s obvious enough what
Let's just say that:
$result = first() || second();
will evaluate to:
if (first()) {
$result = true;
} elseif (second()) {
$result = true;
} else {
$result = false;
}
while:
$result = first() or second();
will evaluate to:
if ($result = first()) {
// nothing
} else {
second();
}
In other words you may consider:
$result = first() || second();
$result = (first() || second());
and:
$result = first() or second();
to be:
($result = first()) || second();
It is just matter of precedence.