Because the varialbe $b has no value out of its function because of its scope, if you really want the thing to work you need to declare the $b variable global. This will print;
This is a
this is b
<?
a();
function a() {
global $b;
$a = "This is a<br>";
print "$a";
b();
print "$b";
}
function b() {
global $b;
$b = "this is b<br>";
return $b;
}
?>