C <-> PHP | Logical or

C

||

Description

par1 || par2
Used keywords: ||

Input


Output

If the first operand is true, then the second operand is not evaluated.

Examples

C

In the source code you can find the equivalent of the above table, for easier orientation at the end of each line is a comment which shows the result.
a1 = 0 || 0; // a1 = false
a2 = 0 || 1;  // a2 = true
a3 = 1  || 0; // a3 = true
a4 = 1  || 1;  // a4 = true

C

Even one example in what situations we can use the operation logical or:
(b || c) || a
a || 1
a>1 || a<100
.
PHP

||

Description

par1 || par2
Used keywords: ||

Input


Output

If the first operand is true, then the second operand is not evaluated.

Examples

PHP

In the source code you can find the equivalent of the above table, for easier orientation at the end of each line is a comment which shows the result.
$a1 = false || false; // a1 = false
$a2 = false || true;  // a2 = true
$a3 = true  || false; // a3 = true
$a4 = true  || true;  // a4 = true

PHP

Even one example in what situations we can use the operation logical or:
($b || $c) || $a
$a || true
$a>1 || $a<100
C

||

Description

par1 || par2
Used keywords: ||

Input


Output

If the first operand is true, then the second operand is not evaluated.

Examples

C

In the source code you can find the equivalent of the above table, for easier orientation at the end of each line is a comment which shows the result.
a1 = 0 || 0; // a1 = false
a2 = 0 || 1;  // a2 = true
a3 = 1  || 0; // a3 = true
a4 = 1  || 1;  // a4 = true

C

Even one example in what situations we can use the operation logical or:
(b || c) || a
a || 1
a>1 || a<100
.
PHP

or

Description

par1 or par2
Used keywords: or

Input


Output

If the first operand is true, then the second operand is not evaluated.

Examples

PHP

In the source code you can find the equivalent of the above table, for easier orientation at the end of each line is a comment which shows the result.
$a1 = false || false; // a1 = false
$a2 = false || true;  // a2 = true
$a3 = true  || false; // a3 = true
$a4 = true  || true;  // a4 = true

PHP

Even one example in what situations we can use the operation logical or:
($b || $c) || $a
$a || true
$a>1 || $a<100

You can find it in the following collections: logical operators
Languages: en hu cz sk