mercredi 16 janvier 2019

Can we merge 'if else' in the structure of switch case?

Can we write like this in PHP or any other programming language:

switch(var)
{
case "1":
if(a==2 || b==3)
{
statement x;
}
break;

default:
statement y;
}

Is it valid?

Aucun commentaire:

Enregistrer un commentaire