php/lang/flow.md

350 B

Flow

$bool = true;

if ($bool)
{

}
elseif ($bool)
{

}
else
{

}


$ret = match($bool)
{
    true => 1,
    false => 0,
    default => 0
};

$ret = match(true)
{
    $bool && true => 1,
    false => 0,
    default => 0
};


while (true)
{
    break;
}


for ($i = 0; i < 10; $i += 1)
{

}


$array = [];
foreach ($arry as $value) 
{

}