It might be clearer when you it like this:
class Blaat {
var $strFoo;
function test() {
global $strFoo;
$this->strFoo = $strFoo;
echo "$strFoo\n";
}
}
$strFoo = "Hello World!";
$bar = new Blaat();
$bar->test();
echo $bar->strFoo ."\n";
This generates this output:
Hello World!
Hello World!
There are better ways to achieve this, without using global..
//Olle