<html><body>
<?php

/* 
Variable Scope
*/

$n = 5;
define ('M',10);

function f()
{
	echo "In f: \$n = $n<BR>\n";
	echo "In f: M = ", M, "<BR>\n";
	echo "In f: R = ", R, "<BR>\n";
	echo "In f: S = ", S, "<BR>\n";
}
define('R',100);
f();
define ('S',1000);

function h($n)
{
	define('M',99);
        echo "In h: \$n = $n<BR>\n";
	echo "In h: M = ", M, "<BR>\n";
        echo "In h: R = ", R, "<BR>\n";
        echo "In h: S = ", S, "<BR>\n";
}
h(5);

function g()
{
	$n = 6;
        echo "In g: \$n = $n<BR>\n";
}
g();
echo "In program after calling g: \$n = $n<BR>\n";

?>
</body></html>
