$a = 5; // global scope $x = 2; // global variable function addition($a, $b) { global $x; $c = $a + $b + $x; // $b as function parameters return $c; // local variable - out of scope apart from this function } $result = addition($a, 4); echo $result .'
'; // output: check it! // run this code to check the output with it's scope var_dump($b); var_dump($c);
Hello World!