Question: I'm doing some validation now in PHP, and I'm running allot of conditional statements, for example:

```

if ($this->email->isValid($email))
return false;
if ($this->username->isValid($username))
return false;

```

ect.. 

Is there a nice way to do this? Or do I just run ten If statements like the ones above?
I can't use `switch` obviously, but I'm looking for that type of solution.. 

P.S... I'm using Zend Framework for validation

Answer: 
You could OR them like this:

```
if(cond1||
   cond2||
   cond3||
   cond4)
{
  return false;
}

```
It is always good to use some var than multiple returns

In case these are the only return conditions. We dont need to check for all conditions. like check only for true conditions return false by default or vice-versa.

$result = false; //return false by default.

if (cond1 || cond2) { //check only for conditions which result in returning true. :)

```
  $result = true;

```

}

return $result;

Cheers,

-Ratnesh