Question: Say I have...

```
function one($x){
     return $a + $x;
}

function two(){
     $a = 5;
     echo one(3);
}

```

Will this show the answer "8" or "3"? In other words, will function one get the value of $a or do I need to declare it global somewhere?

N.B. I haven't tried it yet, but I'm asking it here to understand WHY it acts one way or the other.

Answer: 
No function `one` does not know about `$a`. But this can be done.

```
$a = 5;

function one($x){
 global $a;
 return $a + $x;
}

function two(){
 global $a;
 $a = 5;
 echo one(3);
}

```

Now `two()` would echo `8`
If you to use a class as close as to your example, Notice no global usage, just assign your variables `$this->*` then there global scope within the class and its methods/functions you can also access them from outside of the class like `$functions->a`:

```
<?php 
Class functions{

    function one($x){
        return $this->a + $x;
    }

    function two(){
        $this->a = 5;
        echo $this->one(3);
    }

}

$functions  = new functions();

$functions->two(); //8

echo $functions->a;//5
?>

```