<?php
$globVar = 'Something';

class test{
    public function run(){
        printf("Method 'run' (no global): %s\n", $globVar);
    }
}

$t = new test();
$t->run();



$globVar1 = 'Something';

class test1{
    public function run(){
    	global $globVar1;
    	
        printf("Method 'run' (global): %s\n", $globVar1);
    }
}

$t1 = new test1();
$t1->run();