Free Pascal <-> PHP | Conditional statement
Free Pascal Used keywords: if else then
if then, if then else
Description
if condition then statement1;
if condition then statement1 else statement2;
Input
- condition - Logical value The condition can be any expression
- statement1 - statements
- statement2 - statements
Examples
Free Pascal
Conditional statement the possible of use:if i > 10 then
begin
i :=10; i := i - 1; inc(i);
end;
if i < 10 then i := 10 else i:=1;
.
PHP Used keywords: if else
if, if else
Description
if (condition) statement1
if (condition) statement1 else statement2
Input
- condition - Logical value The condition can be any expression
- statement1 - statements
- statement2 - statements
Examples
PHP
Conditional statement the possible of use:if ($i > 10)
{
$i =10; $i = $i - 1; $i++;
}
if ($i < 10) $i = 10; else $i=1;
Conditional statement in another programming language:
Differences to: