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`
You won't get `8` or `3`. You'll get a Notice since `$a` has not been defined in the scope of the function `one`, and you attempt to read it:

```
PHP Notice:  Undefined variable: a in - on line 3
PHP Stack trace:
PHP   1. {main}() -:0
PHP   2. two() -:11
PHP   3. one() -:8

```