Question: I have two functions which will run based on a conditon.
The code is like

```
$contact=($this->function() or $this->function1())

public function()
{
 some codes
return contact;
}

 public function1()
  {
 some codes
 return contact;
   }

```

It returns me bool true or false in $contact. I want to return the values. what to do?

If I give like this

```
$contact=$this->function() or $this->function1()

```

It does not check the function1() if the function() is false.

Answer: 
You cannot return a value and use `OR` operator  

One Way is to set a variable and value it in the function like this: 

```
    $ret = "";
function ()
{

    $this->ret = "foo";
    return contact;
}

function1() {
    $this->ret = "Bar";
    return contact;
}

$a = function() or function1();
unset($a);
$newRet = $ret;

```

See here for more details:  

<http://php.net/manual/en/language.operators.logical.php>
if you want to check both functions regardless then test for both and save in seperate variables their result, then use those two variables in your if comparison