Hi!
your example will not work.
Reason: you have class A with defined variable. but when you use "A::method()" you don't create class variable. you just call methods from class. So, in methods of class "A" variable $this not defined at this moment.
for right work you can use:
PHP Code:
$classA = new A();
$name = $classA->getname();
echo $name;
Take look on any book about Object-Oriented Programming, read section about anonymous copy of class.