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: 
Since you use boolean operator or, result of 

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

```

is boolean.
In PHP 5.3 you can use ternary operator like this

```
$contact=$this->function() ?: $this->function1();

```

if earlier versions

```
if (!($contact=$this->function() )) $contact=$this->function1();

```

But, generally speaking, I think you must review your functions and change something in their flow. Must probably, make one out of these two and take decision inside this function.
It should be 

```
$contact = $this->A() or $contact = $this->B();

```

Or

```
$contact = $this->A() ?: $this->B();

```